Skip to main content
GET
Get AI Referrals

Authorizations

X-API-Key
string
header
required

Query Parameters

project_id
string

Required if using a company api key

Example:

"or_f45b94ba-5e35-4982-93ed-285e72ee14eb"

start_date
string<date>
required

Inclusive bound, as full-date notation per RFC 3339 section 5.6. Required. A range spans at most 366 days.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Example:

"2026-09-22"

end_date
string<date>
required

Inclusive bound, as full-date notation per RFC 3339 section 5.6. Required. A range spans at most 366 days.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Example:

"2026-09-22"

group_by
enum<string>[]

Dimension(s) to break the numbers down by, at most 3. Omit for period totals only. Pass a single dimension to list the values it takes.

Available options:
assistant,
platform,
source,
medium,
country,
device,
event_name,
landing_page,
page_path,
host
Example:
metrics
enum<string>[]

Metrics to return. Defaults to all of them, minus session_starts when grouping by event_name. Unrequested metrics are left out of the query.

Available options:
events,
session_starts,
conversions,
revenue
Example:
time_bucket
enum<string>

Adds a time_bucket column holding the bucket's start date. There is no hourly bucket: the source data is daily. Buckets at either end of the range cover only the days inside it.

Available options:
day,
week,
month
Example:

"week"

assistants
string[]

Filter by assistant display name. An unrecognised name is rejected rather than ignored.

Example:
sources
string[]

Filter by raw GA4 sessionSource host.

Example:
countries
enum<string>[]

Filter by ISO 3166-1 alpha-2 country code.

Available options:
AE,
AL,
AM,
AR,
AT,
AU,
BA,
BE,
BG,
BH,
BO,
BR,
BS,
BY,
CA,
CH,
CL,
CN,
CO,
CR,
CY,
CZ,
DE,
DK,
DO,
EC,
EE,
EG,
ES,
FI,
FR,
GB,
GE,
GH,
GR,
GT,
HK,
HN,
HR,
HU,
ID,
IE,
IL,
IN,
IQ,
IS,
IT,
JO,
JP,
KR,
KW,
LB,
LI,
LT,
LU,
LV,
MA,
MD,
ME,
MK,
MN,
MT,
MX,
MY,
NG,
NI,
NL,
NO,
NZ,
OM,
PK,
PA,
PE,
PH,
PL,
PT,
PY,
PS,
QA,
RO,
RS,
SA,
SE,
SG,
SI,
SK,
SV,
TH,
TN,
TR,
TW,
UA,
US,
UY,
VE,
VN,
ZA,
AD,
AF,
AS,
AZ,
BB,
BQ,
CG,
CI,
CM,
CW,
DM,
DZ,
FO,
GF,
GP,
JM,
KG,
KH,
KI,
KZ,
LK,
LR,
LS,
MW,
NC,
PG,
TD,
TF,
UG,
VU,
ZW
Example:
mediums
string[]

Filter by GA4 session medium. Use ai-assistant to isolate traffic identified by medium rather than by a known referrer host.

Example:
devices
string[]

Filter by device category. Property-specific and case-sensitive: an unmatched value yields zeros rather than an error.

Example:
event_names
string[]

Filter by GA4 event name. Property-specific: a name this property never sends yields zeros rather than an error, so discover them with group_by=event_name first.

Example:
order_by
enum<string>

Field to sort by, which must be one of the requested metrics (or time_bucket when it is set). Defaults to the first requested metric.

Available options:
events,
session_starts,
conversions,
revenue,
time_bucket
Example:

"session_starts"

order_direction
enum<string>
default:desc
Available options:
asc,
desc
include_total_count
enum<string>
default:true

Set false to skip total_count. Counting is a second pass over the same rows, so it doubles the cost of the call.

Available options:
true,
false
Example:

"false"

limit
integer
default:100
Required range: 1 <= x <= 1000
offset
integer
default:0
Required range: 0 <= x <= 9007199254740991

Response

Success

Success

data
object[]
required
columns
string[]
required

Column order for the rows, derived from the request so a zero-row answer still carries its shape.

Example:
total_count
number | null
required

Number of grouped rows the filters match — not a sum of any metric. Null when include_total_count was false.

Example:

12

currency
string | null
required

Reporting currency of revenue, null when revenue was not requested. Values are not converted, so revenue is not comparable across projects.

Example:

"EUR"