Google Analytics Data API (GA4)
No fee listed
Quota-based. The docs list no charge.
Quota-based (see docs)
OAuth 2.0
OAuth 2.0 scopes analytics.readonly or analytics. Docs examples use a bearer token from Application Default Credentials, so a service account also works.
Sessions, users and events
Traffic sources and channels
Conversions and key events
Realtime activity
Custom dimensions and metrics
Pricing checked on 23 Oct 2026 · Pricing page · Docs · Sign up
Description
The Google Analytics Data API gives programmatic access to GA4 report data. Its results match the Google Analytics interface. It does not work with old Universal Analytics properties.
It suits automated reporting, dashboards and agents that answer questions such as “which channels drove sign-ups last week”. Main methods are runReport, runRealtimeReport (last 30 minutes), batchRunReports and getMetadata, which lists the dimensions and metrics a property has.
Use it if you already run GA4 and want its numbers in your own tools. Skip it if you need raw event-level rows or no-quota access: the API is limited by per-property token quotas, and heavy queries use more tokens.
Key endpoints
POST /v1beta/properties/{id}:runReport: customized report of event dataPOST /v1beta/properties/{id}:runRealtimeReport: realtime events, last 30 minutesPOST /v1beta/properties/{id}:batchRunReports: several reports in one callGET /v1beta/properties/{id}/metadata: available dimensions and metrics
Example request
curl -X POST "https://analyticsdata.googleapis.com/v1beta/properties/YOUR_PROPERTY_ID:runReport" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"dateRanges":[{"startDate":"7daysAgo","endDate":"today"}],"dimensions":[{"name":"country"}],"metrics":[{"name":"activeUsers"}]}'
Tech details
- API style
- REST
- Base URL
- https://analyticsdata.googleapis.com
- Rate limits
- Standard property: 200,000 tokens/day, 40,000 tokens/hour, 10 concurrent requests per property. Analytics 360: 2,000,000/day, 400,000/hour, 50 concurrent.
- Official SDKs
- Java, Python, Node.js, PHP, C#, Go, Ruby
Use Cases
Sessions, users and events
Traffic sources and channels
Conversions and key events
Realtime activity
Custom dimensions and metrics
Editor’s note What our review found
Editorial research, reviewed 23 Oct 2026. We read Google's Data API overview, quota and runReport reference pages. We did not run live calls. This listing is not an endorsement.
Cost: Google's quota page lists limits and no charge. Standard properties get 200,000 tokens per property per day, 40,000 per hour and 10 concurrent requests. Analytics 360 properties get higher limits. You need a Google Cloud project, and requests count against these quotas.
Credentials and data: access uses Google OAuth. The runReport page lists the analytics.readonly and analytics scopes. The docs examples use a bearer token from Application Default Credentials. Keep service account keys and refresh tokens in a secret manager or environment variable, never in code or a plain-text file. The API returns your own analytics data, which may include aggregated audience data, so check your privacy obligations before sending it to third-party tools or AI models.
Good to know: the base path in the docs is v1beta. Some features are Alpha or Beta. Quotas are counted in tokens, not requests, so large or complex reports use up the daily budget faster.