Google Analytics
9 tools • OpenAPI spec ↗
POSTrun_report/properties/:property/reports:runRun a standard report on a GA4 property. Returns dimension and metric data for the given date range. Supports filtering, sorting, pagination, and aggregation.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dimensions | object | No | Array of dimension objects, e.g. [{name: 'city'}]. See GA4 dimension reference. |
| metrics | object | No | Array of metric objects, e.g. [{name: 'activeUsers'}]. See GA4 metric reference. |
| dateRanges | object | No | Array of date range objects, e.g. [{startDate: '2024-01-01', endDate: '2024-01-31'}]. |
| dimensionFilter | object | No | Filter clause for dimensions. |
| metricFilter | object | No | Filter clause for metrics. |
| offset | string | No | Row offset for pagination (as string). |
| limit | string | No | Maximum rows to return (as string). |
| metricAggregations | object | No | Array of aggregation types: TOTAL, MINIMUM, MAXIMUM, COUNT. |
| orderBys | object | No | Array of order-by specifications. |
| currencyCode | string | No | Currency code for monetary metrics (e.g. 'USD'). |
| cohortSpec | object | No | Cohort specification for cohort reports. |
| keepEmptyRows | boolean | No | If true, include rows with all zero metric values. |
| returnPropertyQuota | boolean | No | If true, include property quota info in the response. |
| comparisons | object | No | Array of comparison objects. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "run_report"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "run_report",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/reports:run Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"dimensionHeaders": null,
"metricHeaders": null,
"rows": null,
"totals": null,
"maximums": null,
"minimums": null,
"rowCount": null,
"metadata": null,
"propertyQuota": null,
"kind": null
}POSTrun_pivot_report/properties/:property/reports:runPivotRun a pivot report on a GA4 property. Returns data organized in pivot tables with dimension and metric headers.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dimensions | object | No | Array of dimension objects. |
| metrics | object | No | Array of metric objects. |
| dateRanges | object | No | Array of date range objects. |
| pivots | object | No | Array of pivot objects defining how dimensions are organized in the report. |
| dimensionFilter | object | No | Filter clause for dimensions. |
| metricFilter | object | No | Filter clause for metrics. |
| currencyCode | string | No | Currency code. |
| cohortSpec | object | No | Cohort specification. |
| keepEmptyRows | boolean | No | If true, include rows with all zero metric values. |
| returnPropertyQuota | boolean | No | If true, include property quota info. |
| comparisons | object | No | Array of comparison objects. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "run_pivot_report"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "run_pivot_report",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/reports:runPivot Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"pivotHeaders": null,
"dimensionHeaders": null,
"metricHeaders": null,
"rows": null,
"aggregates": null,
"metadata": null,
"propertyQuota": null,
"kind": null
}POSTrun_realtime_report/properties/:property/reports:runRealtimeRun a realtime report on a GA4 property. Returns current user activity data. Realtime data is available for the last 30 minutes.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dimensions | object | No | Array of dimension objects. |
| metrics | object | No | Array of metric objects. |
| dimensionFilter | object | No | Filter clause for dimensions. |
| metricFilter | object | No | Filter clause for metrics. |
| limit | string | No | Maximum rows to return. |
| metricAggregations | object | No | Array of aggregation types. |
| orderBys | object | No | Array of order-by specifications. |
| returnPropertyQuota | boolean | No | If true, include property quota info. |
| minuteRanges | object | No | Array of minute range objects for filtering realtime data windows. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "run_realtime_report"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "run_realtime_report",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/reports:runRealtime Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"dimensionHeaders": null,
"metricHeaders": null,
"rows": null,
"totals": null,
"maximums": null,
"minimums": null,
"rowCount": null,
"propertyQuota": null,
"kind": null
}POSTbatch_run_reports/properties/:property/reports:batchRunRun multiple standard reports in a single batch request on a GA4 property. More efficient than making individual run_report calls.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| requests | object | No | Array of report request objects. Each request has the same structure as run_report params (dimensions, metrics, dateRanges, etc.). |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "batch_run_reports"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "batch_run_reports",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/reports:batchRun Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"reports": null,
"kind": null
}POSTbatch_run_pivot_reports/properties/:property/reports:batchRunPivotRun multiple pivot reports in a single batch request on a GA4 property. More efficient than making individual run_pivot_report calls.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| requests | object | No | Array of pivot report request objects. Each request has the same structure as run_pivot_report params. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "batch_run_pivot_reports"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "batch_run_pivot_reports",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/reports:batchRunPivot Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"pivotReports": null,
"kind": null
}GETget_metadata/properties/:property/metadataGet metadata about available dimensions and metrics for a GA4 property. Use property ID '0' for universal metadata available to all properties.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID. Use '0' for universal metadata available to all properties. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "get_metadata"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "get_metadata",
"params": {
"property": "<property>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/metadata Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"name": null,
"dimensions": null,
"metrics": null
}POSTcheck_compatibility/properties/:property/compatibility:checkCheck compatibility of dimensions and metrics for a GA4 property. Returns which combinations are compatible for reporting.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| property | string | Yes | GA4 property ID (e.g. 123456) |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dimensions | object | No | Array of dimension objects to check compatibility. |
| metrics | object | No | Array of metric objects to check compatibility. |
| dimensionFilter | object | No | Filter clause for dimensions. |
| metricFilter | object | No | Filter clause for metrics. |
| compatibilityFilter | string | No | Filter to COMPATIBLE or INCOMPATIBLE results. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "check_compatibility"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "check_compatibility",
"params": {
"property": "<property>"
}
}
}
}Request
POST https://app.ferrule.io/api/v1/google-analyticsdata/properties/:property/compatibility:check Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"dimensionCompatibilities": null,
"metricCompatibilities": null
}GETlist_accounts/accountsList all GA4 accounts accessible to the authenticated user. Use this to discover account IDs, then pass them to list_properties to find property IDs usable with the reporting tools.
Request
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pageSize | integer | No | Max accounts per page. Default 50, maximum 200. |
| pageToken | string | No | Page token returned from a previous call to continue pagination. |
| showDeleted | boolean | No | If true, include soft-deleted accounts. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "list_accounts"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "list_accounts",
"params": {}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-analyticsdata/accounts Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"accounts": null,
"nextPageToken": null
}GETlist_properties/accounts/:account/propertiesList GA4 properties under a given account. Pass an account ID (e.g. '123456') to list its properties. The returned 'name' field (e.g. 'properties/987654321') contains the property ID to use with run_report and other reporting tools.
Request
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | GA4 account ID (digits only, e.g. '123456'). |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| pageSize | integer | No | Max properties per page. Default 50, maximum 200. |
| pageToken | string | No | Page token returned from a previous call to continue pagination. |
| showDeleted | boolean | No | If true, include soft-deleted properties. |
Response
Examples
1. Describe method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe_method",
"arguments": {
"service": "google-analyticsdata",
"method": "list_properties"
}
}
}2. Call method
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "call_google-analyticsdata",
"arguments": {
"method": "list_properties",
"params": {
"account": "<account>"
}
}
}
}Request
GET https://app.ferrule.io/api/v1/google-analyticsdata/accounts/:account/properties Authorization: Bearer <your-api-key> Content-Type: application/json
Response
{
"properties": null,
"nextPageToken": null
}