CLIENT API / V1 GOOGLE ANALYTICS 4

Query live GA4 with metrics, dimensions, filters and comparison

GET/sites/{site_id}/ga4/queryanalytics:read

Read live GA4, scoped to the granted site hostname/path. Metrics and dimensions are comma-separated names. filters is a JSON array of {field,operator,value}; operators are EXACT, CONTAINS, BEGINS_WITH, ENDS_WITH. All filters are AND-combined with the mandatory site scope. Comparisons return independent exact reports; never sum distinct users across rows. Uses Google quota but no Satellite credits. keyEvents is canonical; conversions is accepted as an alias. Uses Google live reports and returns separate current/comparison tables. keyEvents is canonical and conversions is an alias. Each period consumes a property/provider request; no Satellite credits are charged. Maximum interval is 366 completed days. Do not sum daily/page distinct users into interval totals.

RequestGET https://satelliteai.io/api/v1/sites/{site_id}/ga4/query
Permissionanalytics:read
ResponseA single object: data is Ga4QueryData.
Operation IDqueryGa4

More context and worked examples are in the developer guide.

Example request

cURL · Bash
curl --fail-with-body --get \
  'https://satelliteai.io/api/v1/sites/123/ga4/query' \
  --data-urlencode 'start_date=2026-10-01' \
  --data-urlencode 'end_date=2026-10-07' \
  -H "Authorization: Bearer $SATELLITE_API_KEY"

Replace the example IDs with values returned by the discovery endpoints. Example values are placeholders, not real records.

Parameters

NameInTypeDescription
site_idrequiredpathintegerAuthorized site id. Parent and site grants must also match.
min 1 · max 9223372036854775807
start_daterequiredquerystring (date)Inclusive YYYY-MM-DD date. Supply both endpoints of an ordered interval; no future dates. At most 366 completed property-local days.
end_daterequiredquerystring (date)Inclusive YYYY-MM-DD date. Supply both endpoints of an ordered interval; no future dates. At most 366 completed property-local days.
metricsquerystringComma-separated 1–10 Google metric names. Default sessions,totalUsers,keyEvents. conversions is normalized to keyEvents. Duplicate names are rejected.
default sessions,totalUsers,keyEvents · max length 1500
dimensionsquerystringComma-separated 0–9 Google dimension names; omitted means no dimensions. Duplicate names are rejected.
max length 1500
filtersquerystringJSON array of 1–10 AND-combined dimension filters with exactly field, operator and value. Operators: EXACT, CONTAINS, BEGINS_WITH, ENDS_WITH (case insensitive). Values are 1–1000 characters. Mandatory site hostname/path constraints are always applied.
max length 12000
comparisonquerystringnone, previous_period (same length immediately before current), previous_year, or custom. A comparison makes a second Google report call.
one of: none, previous_period, previous_year, custom · default none
compare_start_datequerystring (date)Required together with compare_end_date only for comparison=custom. Ordered interval at most 366 completed days.
compare_end_datequerystring (date)Required together with compare_start_date only for comparison=custom.
limitqueryintegerMaximum rows per page. Default 100, maximum 100.
default 100 · min 1 · max 100
offsetqueryintegerZero-based row offset, default 0, maximum 100000.
default 0 · min 0 · max 100000

Unknown or repeated query parameters return 400.

Data dictionary

Scoped result. Lists return pagination metadata; unavailable records return 404.

[] marks an array element. nullable means the value can be null; treat it as unknown, not zero. always present means the key is always included in the object.

Fields in data
FieldTypeDescription
data.site_idintegerGranted Satellite site.
data.sourcestring
one of: live
data.metricsarray of stringCanonical metric names. conversions becomes keyEvents.
data.dimensionsarray of string
data.currentobjectOne exact Google report. row_count is the provider total before limit/offset.
data.current.start_datestringnullableStart date.
data.current.end_datestringnullableEnd date.
data.current.row_countintegernullableRow count.
data.current.rowsarray of map of stringDimension and metric values keyed by the requested canonical names. Metric values are strings.
data.current.metadataobjectGoogle report metadata, including timezone, quality, sampling or threshold information when supplied.
data.comparisonobjectnullableSeparate comparison report; null for comparison=none. No calculated deltas are added.
data.comparison.start_datestringnullableStart date.
data.comparison.end_datestringnullableEnd date.
data.comparison.row_countintegernullableRow count.
data.comparison.rowsarray of map of stringDimension and metric values keyed by the requested canonical names. Metric values are strings.
data.comparison.metadataobjectGoogle report metadata, including timezone, quality, sampling or threshold information when supplied.
data.metric_aliasesobject
data.metric_aliases.conversionsstring
one of: keyEvents
data.credits_chargedintegerSatellite credits charged.
one of: 0

Response metadata

Fields in meta
FieldTypeDescription
meta.request_idstringalways presentRequest identifier; also returned in X-Request-ID. Include it in support requests.
meta.api_versionstringalways presentAPI version that produced the response.
one of: v1
meta.limitintegerMaximum records per page applied to this request.
min 1 · max 100
meta.has_morebooleanTrue when another page is available.
meta.next_cursorstringnullableOpaque cursor for the next page; send as cursor. Null on the last page.
meta.availabilitystringavailable when stored data exists; not_available when it does not.
one of: available, not_available
meta.billingobjectPresent for paid live SERP requests; replayed receipts describe the original debit, not an additional charge.
meta.billing.operationstringalways present
one of: client_api_serp_refresh
meta.billing.credits_chargedintegeralways present
min 0
meta.billing.transaction_idintegeralways present
meta.billing.replayedbooleanalways present

Error responses

Errors return {"error": {"code", "message", "request_id"}}. See error handling for retry guidance.

HTTPWhen
400Invalid parameters
401Invalid credentials
403Missing permission
404Missing or inaccessible resource