We’ve migrated our documentation to a new site, which means some URLs have changed.
Audience

/site

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

siteId

String

No

The identifier of the site to retrieve. Can not be combined with siteIds or siteGroupIds.

siteIds

Array of String

No

An array of identifiers for sites to retrieve. Can not be combined with siteId.

siteGroupIds

Array of String

No

An array of identifiers for site groups whose sites will be retrieved. Can not be combined with siteId.

siteGroupId

String

No

A String of identifier for the site group whose sites will be retrieved. Can not be combined with siteId, or siteGroupIds.

language

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

sites

Array of Object

Array of site objects.

A site object has the following fields:

Name

Type

Description

id

String

Site identifier.

name

String

Site name.

url

String

Site URL. Should specify an URL that represents the site.

country

String

Site country code. Should specify the

ISO 3166-1 alpha-2

associated with the site.

timeZone

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").

sentimentDetection

Boolean

(Experimental) If false, we do not do sentiment detection for this site. If true, sentiment analysis is done. See

Sentiment Analysis

for more details.

automaticCrawling

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.

language

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.

crawlingCookies

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").

crawlingRules

Array of Crawling Rules

Rules for adding meta tags to a page during crawling, see below.

createdAt

String

The creation time. Only available for customer admin (?customerAdmin=true)

createdBy

String

User name of person who created user. Only available for customer admin (?customerAdmin=true)

lastChangedAt

String

The last changing time. Only available for customer admin (?customerAdmin=true)

lastUpdatedBy

String

User name of last person who modified user. Only available for customer admin (?customerAdmin=true)

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

target

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.

sources

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

type

String

Yes

One of meta, javascript, cookie, ignore

name

String

Yes

The name of the source meta tag, javascript variable or expression, or cookie, depending on type. At most 100 characters.

dataSeparator

String

No

The string by which the data should be split.

Examples

Bash
$ python cx.py /site '{"siteId":"9222300742735526873"}'
{
 "sites": [
 {
 "id": "9222300742735526873"
 "name": "Example site",
 "url": "https://www.example.com",
 "country": "US",
 "timeZone": "America/Los_Angeles",
 }
 ]
}
Bash
$ 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

JSON
{
 "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

JSON
{
 "sources": [
 {
 "type": "ignore",
 "name": "http://example.com/article/123*"
 }
 ]
}

Last updated: