AI Traffic (GA4)Get Llm Summary

GA4 summary

Totals of AI-referred site traffic for a domain — sessions, users, and pageviews from LLM/AI sources — plus the previous period for deltas.

curl --request GET \
  --url 'https://api.aiclicks.io/api/v1/ga4/summary?domain_id=8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3&days=30' \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "summary": {
      "total_sessions": 1240,
      "total_users": 980,
      "total_pageviews": 3110
    },
    "previous_summary": {
      "total_sessions": 1010,
      "total_users": 820,
      "total_pageviews": 2670
    }
  },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "generated_at": "2026-07-13T10:00:11.218Z"
}

Headline totals of the traffic that AI assistants (ChatGPT, Perplexity, Claude, Gemini, Copilot…) actually sent to the domain's site, read from its connected Google Analytics 4 property and filtered to LLM/AI referral sources. This is the did AI visibility turn into visitors? number — the complement to the visibility and citation endpoints, which measure appearance inside AI answers rather than clicks out.

The response also returns the previous window of equal length (previous_summary) so you can compute period-over-period deltas without a second call.

domain_id is a required query parameter. Use GET /api/v1/domains to discover which domains the calling key can access. When the domain has no connected GA4 property (or no AI-referred traffic in the window), the call still returns 200 with all totals at 0.

Authorizations

header
Authorizationstring
Required

Your API key formatted as Bearer ak_live_<your-key>. Create one in the dashboard under Settings → Developers.

header
X-Request-Idstring

Optional UUID for log correlation. If omitted, we generate one and echo it back in the response.

Query parameters

query
domain_idstring
Required

UUID of the domain. Find domains via GET /api/v1/domains. Omitting this returns 400.

query
daysinteger

Trailing look-back window, 1–365. Defaults to 30. The previous_summary covers the window of equal length immediately before it.

query
llm_sourcestring

Optional. Restrict to a single AI/LLM referral source — chatgpt, perplexity, claude, gemini, copilot, you, deepseek, grok, … Omit for all sources combined.

Response

dataobject
Required

The summary payload.

summaryobject
Required

Totals across the window for AI-referred traffic.

previous_summaryobject
Required

The same three totals for the immediately preceding window of equal length. All 0 if there is no prior data.

domain_idstring
Required

Echo of the requested domain.

daysinteger
Required

Echo of the requested window.

llm_sourcestring

Echo of the requested llm_source filter, or null when unset.

generated_atstring
Required

ISO-8601 timestamp of when the server produced (or cached) this response.

Response headers

HeaderDescription
X-CacheHIT or MISS. Whether the response came from cache.
X-Request-IdUnique request id. Echoes incoming if you set one.
X-RateLimit-LimitMax requests per minute for this key.
X-RateLimit-RemainingRequests remaining in the current minute.
X-RateLimit-ResetUnix epoch seconds when the window resets.

Caching

Cached for a short window per (domain_id, days, llm_source). Freshly synced GA4 data appears after the TTL expires.

Empty result

If the domain has no GA4 connection — or no AI-referred traffic in the window — the response is a successful 200 with zeroed totals:

{
  "data": {
    "summary": { "total_sessions": 0, "total_users": 0, "total_pageviews": 0 },
    "previous_summary": { "total_sessions": 0, "total_users": 0, "total_pageviews": 0 }
  },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "generated_at": "2026-07-13T10:00:11.218Z"
}