Skip to main content
Beta. This endpoint is new and its response shape may still change. It shares authentication, windowing, and domain scoping with Export Analytics.
Returns a single JSON document of AI referral traffic for every domain on your account — both domains you own and domains shared with you. These are human visitors who arrived on your site from an AI answer surface (ChatGPT, Perplexity, Gemini, Copilot, Claude, and others), detected at the edge by the Referer header. For each domain it breaks the traffic down by AI source, by day, and by landing page.
Always call this endpoint from a server-side environment (backend API, serverless function, build script, etc.). Never include your API key in client-side code — it will be visible to anyone inspecting your frontend.
Programmatic (API key) access requires the Pro plan and above — requests from Starter accounts return 403 plan_upgrade_required.
These counts are a floor, not a total. Some surfaces strip the Referer header, so those visits are invisible here. Google AI Overviews and Bing Copilot-in-search are also excluded on purpose: they share bare search hostnames (google.com, bing.com) with ordinary organic clicks, which would otherwise flood the channel with mis-attributed search traffic.

Request

Headers

Body Parameters

Choose the reporting window in one of two ways — a rolling period, or an explicit startDate/endDate range. The two are mutually exclusive. Range rules — a request that breaks any of these returns 400 invalid_request:
  • period and startDate/endDate cannot be combined.
  • endDate cannot be sent on its own — it requires a startDate.
  • Dates must be real calendar dates in YYYY-MM-DD form (e.g. 2026-02-30 is rejected).
  • startDate must not be after endDate, and neither may be in the future.
  • The range may span at most 365 days (inclusive), the same cap as the 365d period.

Example Request

Response

Success (200)

Fields

AI sources

Each source carries a surfaceType describing the kind of AI surface it is:
Referrers that look like an AI surface but don’t match a known source are bucketed under unknown (surfaceType: "other") so no AI-referred visit is silently dropped.

Error Responses

Examples

JavaScript / Node.js