New to Corsair? See API access, authentication, and error handling.
Export
datapoints
export.datapoints
Export raw page views and events for a date range as JSON datapoints, unsampled, with the fields you name
Risk: read
Export asks for format=json, because the CSV, NDJSON, Parquet and Avro formats cannot be returned intact. Metadata columns appear only when named in metadata_fields, and need their storage suffix; a bare key such as project_text is sent as metadata.project_text.
Output
datapoints full type
datapoints full type
Stats
get
stats.get
Read aggregated stats for one website: page views, visitors, top pages, countries, referrers, UTM values, browsers, operating systems, devices, time on page and event counts
Risk: read
Send at least one field; an empty list returns the version 1 format. The path form reads one page, so pass path rather than the page filter for that; a path of
/ (the homepage) is sent as the page filter. Metadata filters use the bare key as metadata.<key>, without a storage suffix, and every filter given has to match.
Output
histogram full type
histogram full type
pages full type
pages full type
countries full type
countries full type
referrers full type
referrers full type
utm_sources full type
utm_sources full type
utm_mediums full type
utm_mediums full type
utm_campaigns full type
utm_campaigns full type
utm_contents full type
utm_contents full type
utm_terms full type
utm_terms full type
browser_names full type
browser_names full type
os_names full type
os_names full type
device_types full type
device_types full type
events full type
events full type
Websites
add
websites.add
Add a website to the default team, optionally public, with a timezone and a label; needs the owner, admin or developer role and the user id
Risk: write
Needs the owner, admin or developer role, and the team must not have reached its plan website limit. An unrecognised timezone falls back to UTC.
Output
list
websites.list
List every website on the account with its timezone, visibility, whether the script is installed, and its 30-day page view and event estimates; needs the user id
Risk: read
websites full type
websites full type