Google Analytics 4 V1beta API

The V1beta API from Google Analytics 4 — 8 operation(s) for v1beta.

OpenAPI Specification

google-analytics-4-v1beta-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Analytics Data V1beta API
  description: 'The Google Analytics Data API v1 provides programmatic methods to access

    report data in Google Analytics 4 (GA4) properties. Use it to build custom

    reports, run pivot reports, batch run reports, query real-time event data,

    fetch dimension/metric metadata, and create audience exports.

    '
  version: v1beta
servers:
- url: https://analyticsdata.googleapis.com
  description: Google Analytics Data API production endpoint
security:
- OAuth2:
  - analytics.readonly
- OAuth2:
  - analytics
tags:
- name: V1beta
paths:
  /v1beta/{property}:runReport:
    post:
      summary: Run report
      description: Returns a customized report of Google Analytics event data.
      operationId: runReport
      parameters:
      - name: property
        in: path
        required: true
        schema:
          type: string
        example: properties/1234567
        description: GA4 property identifier, e.g. `properties/{propertyId}`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunReportRequest'
      responses:
        '200':
          description: Report response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunReportResponse'
      tags:
      - V1beta
  /v1beta/{property}:runPivotReport:
    post:
      summary: Run pivot report
      description: Returns a customized pivot report of Google Analytics event data.
      operationId: runPivotReport
      parameters:
      - name: property
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Pivot report response
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{property}:batchRunReports:
    post:
      summary: Batch run reports
      description: Returns multiple reports in a batch.
      operationId: batchRunReports
      parameters:
      - name: property
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Batch report response
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{property}:batchRunPivotReports:
    post:
      summary: Batch run pivot reports
      operationId: batchRunPivotReports
      parameters:
      - name: property
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Batch pivot report response
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{property}:runRealtimeReport:
    post:
      summary: Run realtime report
      description: Returns a customized report of real-time event data.
      operationId: runRealtimeReport
      parameters:
      - name: property
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Realtime report response
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{name}/metadata:
    get:
      summary: Get metadata
      description: Returns metadata for dimensions and metrics available in reporting.
      operationId: getMetadata
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
        example: properties/1234567/metadata
      responses:
        '200':
          description: Metadata response
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{parent}/audienceExports:
    post:
      summary: Create audience export
      description: Creates an audience export for later retrieval.
      operationId: createAudienceExport
      parameters:
      - name: parent
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Long-running operation
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
  /v1beta/{name}:
    get:
      summary: Get audience export
      operationId: getAudienceExport
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
        example: properties/1234567/audienceExports/abc123
      responses:
        '200':
          description: Audience export metadata
          content:
            application/json:
              schema:
                type: object
      tags:
      - V1beta
components:
  schemas:
    RunReportResponse:
      type: object
      properties:
        dimensionHeaders:
          type: array
          items:
            type: object
        metricHeaders:
          type: array
          items:
            type: object
        rows:
          type: array
          items:
            type: object
        rowCount:
          type: integer
        metadata:
          type: object
    RunReportRequest:
      type: object
      properties:
        dimensions:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
        metrics:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
        dateRanges:
          type: array
          items:
            type: object
            properties:
              startDate:
                type: string
              endDate:
                type: string
        limit:
          type: string
        offset:
          type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            analytics: View and manage Google Analytics data
            analytics.readonly: View Google Analytics data