Google AnalyticsGoogle AnalyticsSEO/AEO

GA4 realtime active users by page, source, country

google-analytics.realtime

See who is on your site right now (active users by page, source and country)

Price
freeAt list price
Success rate
100%Last 30 days · 1,086 calls
Latency p50
368 msp95 572 ms
Last verified
Jul 28, 2026Verified working
POSThttps://toolswitch.dev/v1/tools/google-analytics.realtimeBeta
  • Uses platform quota
  • Synchronous response
  • Reads public data

Parameters

covers the last 30 minutes only, and takes NO dateRanges — passing one is an error. Reusing a standard-report dimension name here is the usual failure

ParameterTypeRequiredDescriptionExample
Path parameters
property_idstringRequired123456789
Request body (JSON)
limitintegerOptional20
metricsarrayRequiredactiveUsers, screenPageViews, conversions[{"name":"activeUsers"}]
dimensionsarrayOptionalrealtime has its OWN smaller dimension set — unifiedScreenName, country, deviceCategory, audienceName; pagePath is not among them[{"name":"unifiedScreenName"}]
minuteRangesarrayOptionalwindows within the last 30 minutes, e.g. [{"startMinutesAgo":29,"endMinutesAgo":0}]
  • Path parameters
  • property_idstringRequired

    Example: 123456789

  • Request body (JSON)
  • limitintegerOptional

    Example: 20

  • metricsarrayRequired

    activeUsers, screenPageViews, conversions

    Example: [{"name":"activeUsers"}]

  • dimensionsarrayOptional

    realtime has its OWN smaller dimension set — unifiedScreenName, country, deviceCategory, audienceName; pagePath is not among them

    Example: [{"name":"unifiedScreenName"}]

  • minuteRangesarrayOptional

    windows within the last 30 minutes, e.g. [{"startMinutesAgo":29,"endMinutesAgo":0}]

Code samples

Replace $TOOLSWITCH_KEY with the key you created in the console.

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/google-analytics.realtime' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"limit":3,"metrics":[{"name":"activeUsers"}],"dimensions":[{"name":"country"}]}'

This gateway API is in beta; its URL and authentication may change. The example parameters are sample data. Calls are billed at free, including the service fee.