Skip to content

Google Analytics Data API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

Accesses report data in Google Analytics.

Google Analytics Data API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 7 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://analyticsdata.googleapis.com/
Version
v1beta
Endpoints
7
Spec updated
2023-04-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://analyticsdata.googleapis.com/v1beta/NAME" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://analyticsdata.googleapis.com/v1beta/NAME", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://analyticsdata.googleapis.com/v1beta/NAME",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/v1beta/{name}Returns metadata for dimensions and metrics available in reporting methods. Used to explore the dimensions and metrics. In this method, a Google Analytics GA4 P
POST/v1beta/{property}:batchRunPivotReportsReturns multiple pivot reports in a batch. All reports must be for the same GA4 Property.
POST/v1beta/{property}:batchRunReportsReturns multiple reports in a batch. All reports must be for the same GA4 Property.
POST/v1beta/{property}:checkCompatibilityThis compatibility method lists dimensions and metrics that can be added to a report request and maintain compatibility. This method fails if the request's dime
POST/v1beta/{property}:runPivotReportReturns a customized pivot report of your Google Analytics event data. Pivot reports are more advanced and expressive formats than regular reports. In a pivot r
POST/v1beta/{property}:runRealtimeReportReturns a customized report of realtime event data for your property. Events appear in realtime reports seconds after they have been sent to the Google Analytic
POST/v1beta/{property}:runReportReturns a customized report of your Google Analytics event data. Reports contain statistics derived from data collected by the Google Analytics tracking code. T

Questions

Does the Google Analytics Data API API need an API key?

Yes. The Google Analytics Data API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Google Analytics Data API API support HTTPS?

Yes, the Google Analytics Data API API is served over HTTPS.

How many endpoints does the Google Analytics Data API API have?

Its OpenAPI description lists 7 endpoints in version v1beta. All of them are shown on this page.

What are alternatives to the Google Analytics Data API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).