Google AnalyticsGoogle AnalyticsSEO/AEO

Run a custom GA4 report by property id

google-analytics.report

Run a traffic or behaviour report on your own Google Analytics property

Price
freeAt list price
Success rate
100%Last 30 days · 15,619 calls
Latency p50
545 msp95 2.3 s
Last verified
Jul 28, 2026Verified working
POSThttps://toolswitch.dev/v1/tools/google-analytics.reportBeta
  • Uses platform quota
  • Synchronous response
  • Reads public data

Parameters

request shape previously live-verified via the registry entry's examples. An incompatible dimension/metric pair fails the whole call — check google.analytics.metadata for what combines. Sampling and thresholding are reported back in the response metadata, not as an error

ParameterTypeRequiredDescriptionExample
Path parameters
property_idstringRequirednumeric GA4 property id (the digits only — the admin API returns it as 'properties/123456789')123456789
Request body (JSON)
limitintegerOptionaldefault 10000, max 250000100
offsetintegerOptional0
metricsarrayOptional[{name: …}] — e.g. screenPageViews, sessions, activeUsers, conversions, engagementRate[{"name":"screenPageViews"}]
orderBysarrayOptionale.g. [{"metric":{"metricName":"sessions"},"desc":true}]
dateRangesarrayRequiredup to 4 ranges. Use 'yesterday' or 'NdaysAgo', not 'today' — today is a partial day and always reads low[{"endDate":"yesterday","startDate":"28daysAgo"}]
dimensionsarrayOptional[{name: …}] — e.g. pagePath, sessionSource, sessionDefaultChannelGroup, country, deviceCategory, date[{"name":"pagePath"}]
keepEmptyRowsbooleanOptional
dimensionFilterobjectOptionale.g. {"filter":{"fieldName":"pagePath","stringFilter":{"matchType":"CONTAINS","value":"/blog/"}}}
  • Path parameters
  • property_idstringRequired

    numeric GA4 property id (the digits only — the admin API returns it as 'properties/123456789')

    Example: 123456789

  • Request body (JSON)
  • limitintegerOptional

    default 10000, max 250000

    Example: 100

  • offsetintegerOptional

    Example: 0

  • metricsarrayOptional

    [{name: …}] — e.g. screenPageViews, sessions, activeUsers, conversions, engagementRate

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

  • orderBysarrayOptional

    e.g. [{"metric":{"metricName":"sessions"},"desc":true}]

  • dateRangesarrayRequired

    up to 4 ranges. Use 'yesterday' or 'NdaysAgo', not 'today' — today is a partial day and always reads low

    Example: [{"endDate":"yesterday","startDate":"28daysAgo"}]

  • dimensionsarrayOptional

    [{name: …}] — e.g. pagePath, sessionSource, sessionDefaultChannelGroup, country, deviceCategory, date

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

  • keepEmptyRowsbooleanOptional
  • dimensionFilterobjectOptional

    e.g. {"filter":{"fieldName":"pagePath","stringFilter":{"matchType":"CONTAINS","value":"/blog/"}}}

Code samples

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

Beta
curl -X POST 'https://toolswitch.dev/v1/tools/google-analytics.report' \
  -H "X-Toolswitch-Key: $TOOLSWITCH_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{"limit":3,"metrics":[{"name":"sessions"}],"dateRanges":[{"endDate":"yesterday","startDate":"28daysAgo"}],"dimensions":[{"name":"sessionDefaultChannelGroup"}]}'

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.