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

/content/keyword

This top-level API aggregates the so-called content keyword documents (content profiles), associated with a given site or set of sites, and computes various metrics for a specified slice of data. The slice is defined by combining filters. Filters can be defined for keywords in content profiles. This API is useful for answering questions such as "find the number of unique sports pages mentioning Donald Trump", where "sports pages mentioning Donald Trump" are the subject to filtering and the requested result is a set of metrics, i.e., the number of unique pages.

The user must be authenticated and have read permissions to the specified sites.

Request

The request object has the following fields:

Name

Type

Required

Description

siteIds

Array of String

No

The set of sites to aggregate over.

siteId

String

No

The site to aggregate over. A more convenient alternative to siteIds, in the case of just one site.

siteGroupIds

Array of String

No

The set of site groups to aggregate over.

siteGroupId

String

No

The site group to aggregate over. A more convenient alternative to siteGroupIds, in the case of just one site group.

filters

Array of Object

No

Filters

to be applied. Conjunctive semantics (and) are assumed for the top-level filters.

Fields

Fields specify which metrics to aggregate. Currently, the following fields are supported:

Name

Implicit

Description

urls

Yes

The number of unique pages (i.e. content profiles, i.e. keyword documents).

Response

The response object has the following fields:

Name

Type

Description

data

Object

The field names and aggregated numbers.

Examples

The number of unique pages mentioning Donald Trump

Bash
$ python cx.py /content/keyword '{"siteId":"12345", "filters":[{"type":"keyword","group":"person","item":"Trump"}]}'
{
 "data": {
 "urls": 1777
 }
}

The number of unique pages associated with football in some way

Bash
$ python cx.py /content/keyword '{"siteId":"12345", "fields":["urls"], "filters":[{"type":"keyword","group":"term","item":"football"}]}'
{
 "data": {
 "urls": 93
 }
}

The number of unique pages associated with football, but with filters defined in a segment

Bash
$ python cx.py /content/keyword '{"siteId":"12345", "filters":[{"type":"segment","item":"<football_segment_id>"}]}}'
{
 "data": {
 "urls": 93
 }
}

The number of unique pages associated with football, or mentioning Donald Trump

Bash
$ python cx.py /content/keyword '{"siteIds":["12345"], "filters":[{"type":"or", "filters":[{"type":"keyword","group":"term","item":"football"},{"type":"keyword","group":"person","item":"Trump"}]}]}'
{
 "start": 1416291900,
 "stop": 1416295500,
 "data": {
 "urls": 1870
 }
}

Last updated: