Retrieves information about one or more sites.
Note: The user must be authenticated and have read permissions to the given site or site group.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
No |
The identifier of the site to retrieve. Can not be combined with |
|
|
Array of String |
No |
An array of identifiers for sites to retrieve. Can not be combined with |
|
|
Array of String |
No |
An array of identifiers for site groups whose sites will be retrieved. Can not be combined with |
|
|
String |
No |
A String of identifier for the site group whose sites will be retrieved. Can not be combined with |
|
|
String |
No |
Identifier to filter sites for a particular language. Can be combined with all the fields above. |
If no parameters are specified, all sites the user has read permissions to are retrieved.
Response
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
Array of Object |
Array of site objects. |
A site object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Site identifier. |
|
|
String |
Site name. |
|
|
String |
Site URL. Should specify an URL that represents the site. |
|
|
String |
Site country code. Should specify the ISO 3166-1 alpha-2 associated with the site. |
|
|
String |
Site time zone identifier. Should be specified using the full name from IANA time zone database (e.g. "America/Los_Angeles") or a GMT offset (e.g. "GMT-08:00"). |
|
|
Boolean |
(Experimental) If Sentiment Analysis for more details. |
|
|
Boolean |
If false, no automatic crawling will be performed. See /document/update and /profile/content/push for how to manually update content for the site. |
|
|
String |
Language to use for content processing. If not set language will be automatically detected according to the top level domain of the processed url and/or the content. |
|
|
Array of String |
Cookie strings the crawler will set in the browser before loading a page. Each according to https://tools.ietf.org/html/rfc6265#section-4.1.1 with required domain attribute. The only difference from this rfc is that in order for cookie to be applied to subdomains, it must have a leading dot (e.g ".domain.com"). |
|
|
Array of Crawling Rules |
Rules for adding meta tags to a page during crawling, see below. |
|
|
String |
The creation time. Only available for customer admin ( |
|
|
String |
User name of person who created user. Only available for customer admin ( |
|
|
String |
The last changing time. Only available for customer admin ( |
|
|
String |
User name of last person who modified user. Only available for customer admin ( |
The url field is also used for verification purposes when creating a site search index. The validation occurs on top private domain, e.g., foo.com, foo.co.jp, or foo.co.uk. The top private domain is extracted from the url field and documents under that are allowed to enter the index. It is not currently possible to configure specific subdomains or subpaths, e.g., foo.com/bar/, for site search purposes. Note that the url field has to be where the site is actually hosted and not a redirect link. E.g., if you have a site example.com that redirects to example.othersite.com then othersite.com is the correct value.
Crawling rules
Each Crawling Rule is an object with the following fields
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
A meta tag will be created with this name and content from the sources, if any of the sources have a value. At most 100 characters. |
|
|
Array of Sources |
Yes |
A list of sources. The first source that has a value will be used. |
Each Source is an object with the following fields
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
One of |
|
|
String |
Yes |
The name of the source meta tag, javascript variable or expression, or cookie, depending on type. At most 100 characters. |
|
|
String |
No |
The string by which the data should be split. |
Examples
$ python cx.py /site '{"siteId":"9222300742735526873"}'
{
"sites": [
{
"id": "9222300742735526873"
"name": "Example site",
"url": "https://www.example.com",
"country": "US",
"timeZone": "America/Los_Angeles",
}
]
}
$ python cx.py /site '{"siteGroupId":"1222300742735526876", "language":"en"}'
{
"sites": [
{
"id": "9222300742735526873"
"name": "Example site",
"url": "https://www.example.com",
"country": "US",
"language": "en",
"timeZone": "America/Los_Angeles",
},
{
"id": "9222300742735526874"
"name": "Example site2",
"url": "https://www.example2.com",
"country": "US",
"language": "en",
"timeZone": "America/Los_Angeles",
}
]
}
Exclude rule examples
Strict correspondence of the article address. Exclude url equals http://example.com/article/123
{
"sources": [
{
"type": "ignore",
"name": "http://example.com/article/123"
}
]
}
Non-strict correspondence of the article address. Exclude all urls contains http://example.com/article/123
{
"sources": [
{
"type": "ignore",
"name": "http://example.com/article/123*"
}
]
}