Export the visitor analytics
export_site_analytics
Exports the all-time visitor analytics of a site in one call, as top pages, sources, countries, browsers, operating systems and devices.
Each breakdown is a list of names with their visitors and pageviews counts, up to 1,000 entries each, under pages, sources, countries, browsers, operatingSystems and devices. This is the whole picture at once, where query_site_analytics answers one question at a time, and it is the same data as Export .csv in the Analytics tab.
It needs the workspace to be on a paid plan, and a free one is refused with A paid plan is required to export! A site with no traffic recorded comes back successful with every list empty rather than as an error, but if the analytics backend cannot answer, the call fails with an error rather than returning empty lists.
Each call costs 6 of the 1,200 analytics lookups access tokens share per site per hour, one per breakdown, as Rate limits and result size explains. A breakdown already cached costs nothing, and neither does a site that was never published. Over that limit it fails with Access tokens, through MCP clients or the API, used their 1,200 analytics lookups for this site this hour. Wait and try again! See Export.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |