AI Traffic (GA4)Get Llm Timeline

GA4 timeline

Daily AI-referred sessions for a domain over the window, each day broken down by LLM source.

curl --request GET \
  --url 'https://api.aiclicks.io/api/v1/ga4/timeline?domain_id=8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3&days=30' \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "items": [
      { "date": "2026-07-01", "sessions": 44, "by_llm": { "chatgpt": 30, "claude": 14 } },
      { "date": "2026-07-02", "sessions": 51, "by_llm": { "chatgpt": 35, "perplexity": 16 } },
      { "date": "2026-07-03", "sessions": 39, "by_llm": { "chatgpt": 28, "gemini": 11 } }
    ]
  },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "generated_at": "2026-07-13T10:00:11.218Z"
}

The day-by-day time-series of AI-referred traffic: one row per date with the total sessions for that day and a by_llm breakdown of how those sessions split across assistants. Use it to chart the trend of AI-driven visits, spot the day a campaign or a new citation started sending traffic, and compare assistants over time.

Rows are sorted by date ascending. Days with no AI-referred traffic are simply absent from the list.

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), items is empty with a 200.

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. One row per day that had AI-referred traffic.

query
llm_sourcestring

Optional. Restrict to a single AI/LLM referral source — chatgpt, perplexity, claude, gemini, copilot, … With a filter set, each day's sessions and by_llm reflect only that source. Omit for all sources.

Response

dataobject
Required

The list payload.

data.itemsarray
Required

One row per date with AI-referred traffic, sorted by date ascending.

datestring
Required

Calendar date, YYYY-MM-DD.

sessionsinteger
Required

Total AI-referred sessions on that date (sum of by_llm).

by_llmobject
Required

Map of LLM source → sessions on that date (e.g. { "chatgpt": 30, "claude": 14 }).

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

{
  "data": { "items": [] },
  "domain_id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
  "days": 30,
  "llm_source": null,
  "generated_at": "2026-07-13T10:00:11.218Z"
}