Analytics

GET /analytics/(type)

Returns a list of posts, authors, sections or tags depending on the specified type. This is typically used to generate front page or article page widgets featuring your "Most Popular" content. Use analytics-detail to retrieve drill-downs to posts for "authors" and "sections" listings.

Path Arguments

type One of posts, authors, sections, tags, referrers

Optional Parameters

period_start Start of date range to consider traffic from; see Date/Time Handling for formatting details. Defaults to 3 days ago, limited to most recent 90 days.
period_end End of date range to consider traffic from; see Date/Time Handling for formatting details. Defaults to current date and time if not specified.
pub_date_start Publication filter start date; see Date/Time Handling for formatting details. This option is only available for posts.
pub_date_end Publication filter end date; see Date/Time Handling for formatting details. Defaults to current date and time if not specified. This option is only available for posts.
section (Posts only) Filter the current top posts by a specific section
author (Posts only) Filter the current top posts by a specific author
tag (Posts only) Filter the current top posts by a specific tag
sort Sort value; default is views (popularity). See Available Metrics for complete list of options
limit Number of records to retrieve; defaults to "10".
page Page number to retrieve if multiple pages are available; defaults to 1. Retrieving a page that is unavailable returns an empty record list.
callback JSON-P callback, a JavaScript function name that will be used to wrap the JSON response. The API also supports Cross-Origin Response Sharing.

The maximum pagination limit is 2000 records. You will receive an error from the API if you attempt to retrieve past record 2000 through any combination of page and limit.

GET /analytics/post/detail

Returns the post's metadata, as well as total views and visitors in the metrics field. By default, this returns the total pageviews on the link for the last 90 days.

Query Parameters

url URL of post to fetch details on. This must be in canonical form, including "http://" scheme

Optional Parameters

period_start Start of period to consider traffic from; see Date/Time Handling for formatting details. Defaults to 90 days and is limited to the most recent 90 days.
period_end End of period to consider traffic from; see Date/Time Handling for formatting details. Defaults to current date and time if not specified.
callback JSON-P callback, a JavaScript function name that will be used to wrap the JSON response. The API also supports Cross-Origin Response Sharing.

GET /analytics/(meta)/(value)/detail

Returns a list of posts falling under the specified author, section or tag. This is typically used in one of two scenarios. On its own, it can be used to enrich article pages with "Most Popular Posts by this Author" and section pages with "Most Popular Posts in this Section". In combination with analytics, it can be used to implement a drill-down -- first, you retrieve a list of most popular authors with that endpoint, then you drill into the posts for one specific author with this endpoint.

Path Arguments

meta one of author, section, tag

Optional Parameters

period_start Start of period to consider traffic from; see Date/Time Handling for formatting details. Defaults to 2 weeks and is limited to the most recent 90 days.
period_end End of period to consider traffic from; see Date/Time Handling for formatting details. Defaults to current date and time if not specified.
pub_date_start Publication filter start date; see Date/Time Handling for formatting details.
pub_date_end Publication filter end date; see Date/Time Handling for formatting details. Defaults to current date and time if not specified.
sort Sort value; default is views (popularity). See Available Metrics for complete list of options
limit Number of records to retrieve; defaults to 10.
page Page number to retrieve if multiple pages are available; defaults to 1. Retrieving a page that is unavailable returns an empty record list.
callback JSON-P callback, a JavaScript function name that will be used to wrap the JSON response. The API also supports Cross-Origin Response Sharing.

The maximum pagination limit is 2000 records. You will receive an error from the API if you attempt to retrieve past record 2000 through any combination of page and limit.

Do you have an urgent support question?