AI & Agent Traffic
What AI actually sends to your site: referral traffic covers humans arriving from AI assistants, agent traffic covers the AI crawlers hitting your origin server.
GET/metrics/ai_traffic
Returns the AI-referred traffic measured from a project's connected web analytics provider (Google Analytics 4, Adobe Analytics, PostHog, Plausible or Piano): per-day users, sessions and conversions grouped by AI source (ChatGPT, Perplexity, Gemini, Claude and others), with totals and a conversion rate. Requires the Scale plan or above and a connected provider; projects without one return ERR_AI_TRAFFIC_NOT_CONNECTED (404).
project_idrequiredrangefromtogranularityday|week|monthsourcerestrict to one AI source
GET/web_analytics/schema
Describes how to query the project's connected web analytics provider live: which provider and property, the native query format it accepts, the allowed top-level fields, the rules this endpoint enforces, a worked example and, where the provider offers it, its live field list (every GA4 dimension and metric including custom definitions, Adobe dimension and metric ids, Matomo report methods, recent PostHog events, the Plausible catalog). Cached for an hour. Unlike /metrics/ai_traffic, which returns the AI referral numbers already stored by the AI Traffic sync, these endpoints read the provider directly. Projects without a connected provider return ERR_WEB_ANALYTICS_NOT_CONNECTED (404). Requires the Growth plan or above. MCP: get_web_analytics_schema.
project_idrequired
POST/web_analytics/query
Runs a live, read-only query against the web analytics provider connected to the project and returns columns and rows. Write the query in the provider's own format: a GA4 Data API runReport body, an Adobe Analytics or Customer Journey Analytics report request, Matomo Reporting API parameters (get methods only), PostHog HogQL, a Plausible Stats API v2 query or a Piano getData body. The connected property, site, report suite or project is always used and any property field in the query is ignored. Rows default to 100 and are capped at 5,000; identical queries are answered from a 10-minute cache (cached: true). A query the provider rejects returns ERR_WEB_ANALYTICS_INVALID_QUERY (422) with the provider's own validation message. Each uncached query spends the provider API quota the AI Traffic sync shares, and a project allows 20 uncached queries a minute (ERR_WEB_ANALYTICS_UPSTREAM, 503, with Retry-After). Requires the Growth plan or above; no writable key is needed. MCP: query_web_analytics.
- JSON body:
project_id(required),query(required): the native query object, or for PostHog the HogQL string or{"query": "SELECT ..."}.
GET/metrics/agent_traffic
Aggregated AI bot traffic for a project, grouped by bot or by company, with daily/weekly/monthly granularity.
project_idrequiredrangefromtobotcompanygroup_bybot|companygranularityday|week|month
GET/dimensions/agent_bots
Static catalog of AI bots that Agent Analytics can identify. Use it to render filter UIs that mirror our internal classification (slug, display name, company, category, Cloudflare verified-bot mapping). Requires Scale or above; the MCP tool list_agent_bots is available on the Scale plan or above.
project_idrequired