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

Preço
freePelo preço de tabela
Taxa de sucesso
100%Últimos 30 dias · 15.619 chamadas
Latência p50
545 msp95 2.3 s
Última verificação
28 de jul. de 2026Verificado e funcionando
POSThttps://toolswitch.dev/v1/tools/google-analytics.reportBeta
  • Usa a cota da plataforma
  • Resposta síncrona
  • Lê dados públicos

Parâmetros

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

ParâmetroTipoObrigatórioDescriçãoExemplo
Parâmetros de caminho
property_idstringObrigatórionumeric GA4 property id (the digits only — the admin API returns it as 'properties/123456789')123456789
Corpo (JSON)
limitinteiroOpcionaldefault 10000, max 250000100
offsetinteiroOpcional0
metricsmatrizOpcional[{name: …}] — e.g. screenPageViews, sessions, activeUsers, conversions, engagementRate[{"name":"screenPageViews"}]
orderBysmatrizOpcionale.g. [{"metric":{"metricName":"sessions"},"desc":true}]
dateRangesmatrizObrigatórioup to 4 ranges. Use 'yesterday' or 'NdaysAgo', not 'today' — today is a partial day and always reads low[{"endDate":"yesterday","startDate":"28daysAgo"}]
dimensionsmatrizOpcional[{name: …}] — e.g. pagePath, sessionSource, sessionDefaultChannelGroup, country, deviceCategory, date[{"name":"pagePath"}]
keepEmptyRowsbooleanoOpcional
dimensionFilterobjetoOpcionale.g. {"filter":{"fieldName":"pagePath","stringFilter":{"matchType":"CONTAINS","value":"/blog/"}}}
  • Parâmetros de caminho
  • property_idstringObrigatório

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

    Exemplo: 123456789

  • Corpo (JSON)
  • limitinteiroOpcional

    default 10000, max 250000

    Exemplo: 100

  • offsetinteiroOpcional

    Exemplo: 0

  • metricsmatrizOpcional

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

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

  • orderBysmatrizOpcional

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

  • dateRangesmatrizObrigatório

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

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

  • dimensionsmatrizOpcional

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

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

  • keepEmptyRowsbooleanoOpcional
  • dimensionFilterobjetoOpcional

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

Exemplos de código

Substitua $TOOLSWITCH_KEY pela chave criada no 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"}]}'

Esta API de gateway está em Beta; a URL e a autenticação podem mudar. Os parâmetros do exemplo são dados de amostra. As chamadas são cobradas a free, incluindo a taxa de serviço.