> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Ads

> Your Google Ads accounts: GAQL reports on campaigns, spend, clicks and conversions, and Keyword Planner ideas and volumes.

![](https://mintcdn.com/webrouter/gPu3tCeozwRcDBjt/logo/data-apis/google-ads.webp?fit=max\&auto=format\&n=gPu3tCeozwRcDBjt\&q=85\&s=2c9e9cfe1101e4a906b7635993a7e1e1)

[Web Catalog · Advertising](https://docs.webrouter.net/data-apis.md?category=advertising)

Needs&#x20;

`GOOGLE_ADS_DEVELOPER_TOKEN`

,&#x20;

`GOOGLE_ADS_CLIENT_ID`

,&#x20;

`GOOGLE_ADS_CLIENT_SECRET`

,&#x20;

`GOOGLE_ADS_REFRESH_TOKEN`

Endpoints

6

Auth

OAuth refresh token

[Vendor docs](https://developers.google.com/google-ads/api/rest/overview)

&#x20;·&#x20;

[Pricing](https://developers.google.com/google-ads/api/docs/access-levels)

## Setup

| Variable | | What it is |
| - | - | - |
| `GOOGLE_ADS_DEVELOPER_TOKEN` | required | a Google Ads developer token (manager account > Admin > API Center) |
| `GOOGLE_ADS_CLIENT_ID` | required | the OAuth client id of a Google Cloud OAuth app with the Google Ads API enabled |
| `GOOGLE_ADS_CLIENT_SECRET` | required | that OAuth app's client secret |
| `GOOGLE_ADS_REFRESH_TOKEN` | required | a refresh token for the adwords scope, minted with that OAuth app |
| `GOOGLE_ADS_API_VERSION` | optional | Google retires each major version about a year after release (v26: Oct 2026, sunsets Nov 2027). A sunset version answers 400 UNSUPPORTED\_VERSION; pin one only to stay on it deliberately. Default `v26`. One of `v26`, `v25`, `v24`, `v23`. |
| `GOOGLE_ADS_LOGIN_CUSTOMER_ID` | optional | The manager (MCC) account id, digits only, when your login reaches client accounts through a manager. Leave unset when you are a user of the client account itself. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Two credentials on every call: an OAuth access token for a user with access to the account, and the developer token of an approved manager account. A missing or unapproved developer token answers DEVELOPER\_TOKEN\_\* errors, not 401.
* Google has no read-only Ads scope: the adwords scope can read and change everything the user can. The catalog lists only read endpoints; a mutate through vendor\_request is still refused unless allow\_writes is passed.
* Customer ids are digits only: strip the dashes the Ads UI shows (123-456-7890 -> 1234567890).
* Money is in MICROS of the account currency: divide cost\_micros by 1,000,000.
* A test developer token only reaches test accounts; Basic access caps daily operations (see pricing\_url).

## Endpoints

GET

List the Google Ads accounts your login can reach

Resource names (customers/1234567890) of every account the authenticated user can access directly. Ids only: run a GAQL query on customer for names.

[Open](#google-ads-customers-list-accessible)

POST

Run a GAQL report on a Google Ads account

A Google Ads Query Language query -- campaigns, ad groups, keywords, spend, clicks, conversions by date -- one page of up to 10,000 rows.

[Open](#google-ads-query)

POST

Run a GAQL report and get every row at once

The same query as google-ads.query, returned whole with no paging. Suits results that fit in memory: bound it with LIMIT or a date range.

[Open](#google-ads-query-stream)

POST

Look up GAQL fields and resources

Which fields exist, are selectable, filterable or sortable, and which resources they can be queried with -- the GAQL schema.

[Open](#google-ads-fields-search)

POST

Get keyword ideas from Keyword Planner

Keyword ideas from seed keywords, a URL or a whole site, with average monthly searches, competition and top-of-page bid ranges.

[Open](#google-ads-keywords-ideas)

POST

Get search volume and bids for a keyword list

Average monthly searches, competition and top-of-page bid range for up to 10,000 keywords you name.

[Open](#google-ads-keywords-historical-metrics)

### List the Google Ads accounts your login can reach

GET

`/customers:listAccessibleCustomers`

`google-ads.customers.list_accessible`

Resource names (customers/1234567890) of every account the authenticated user can access directly. Ids only: run a GAQL query on customer for names.

Input

No inputs.

[Vendor docs](https://developers.google.com/google-ads/api/rest/examples) · Same job: [Pinterest Ads](https://docs.webrouter.net/data-apis/pinterest-ads.md#pinterest-ads-accounts-list), [Snapchat Ads](https://docs.webrouter.net/data-apis/snapchat-ads.md#snapchat-ads-organizations-list)

```python Python theme={null}
router.call_data_api("google-ads.customers.list_accessible")
```

```text MCP theme={null}
call_data_api(endpoint="google-ads.customers.list_accessible")
```

> [!NOTE]
>
> * Ignores login-customer-id: it lists what the user reaches, not what a manager does.

### Run a GAQL report on a Google Ads account

POST

`/customers/{customer_id}/googleAds:search`

`google-ads.query`

A Google Ads Query Language query -- campaigns, ad groups, keywords, spend, clicks, conversions by date -- one page of up to 10,000 rows.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`customer_id` required</td><td>string</td><td>path</td><td>Digits only. Example `1234567890`</td></tr>
    <tr><td>`query` required</td><td>string</td><td>body</td><td>GAQL. Metrics need a FROM resource that has them and usually a segments.date filter. Example `SELECT campaign.name, metrics.cost_micros, metrics.clicks, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC LIMIT 50`</td></tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        nextPageToken from the previous answer; send the same query.
      </td>
    </tr>

    <tr>
      <td>
        `searchSettings`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td>
        \{returnTotalResultsCount, returnSummaryRow, omitResultsDetails}.
      </td>
    </tr>

    <tr>
      <td>
        `validateOnly`
      </td>

      <td>
        boolean
      </td>

      <td>
        body
      </td>

      <td>
        Check the query without running it.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/google-ads/api/rest/common/search) · Same job: [Meta Ads (Marketing API)](https://docs.webrouter.net/data-apis/meta-ads.md#meta-ads-insights-get), [Pinterest Ads](https://docs.webrouter.net/data-apis/pinterest-ads.md#pinterest-ads-analytics-account), [Snapchat Ads](https://docs.webrouter.net/data-apis/snapchat-ads.md#snapchat-ads-stats-campaign), [TikTok Ads (Marketing API)](https://docs.webrouter.net/data-apis/tiktok-ads.md#tiktok-ads-report-query)

```python Python theme={null}
router.call_data_api("google-ads.query", {'customer_id': '1234567890', 'query': 'SELECT campaign.name, metrics.cost_micros, metrics.clicks, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC LIMIT 50'})
```

```text MCP theme={null}
call_data_api(endpoint="google-ads.query", params={"customer_id": "1234567890", "query": "SELECT campaign.name, metrics.cost_micros, metrics.clicks, metrics.conversions FROM campaign WHERE segments.date DURING LAST_30_DAYS ORDER BY metrics.cost_micros DESC LIMIT 50"})
```

> [!NOTE]
>
> * A read over POST. Pages are a fixed 10,000 rows and pageSize is refused (PAGE\_SIZE\_NOT\_SUPPORTED): bound the result with GAQL's LIMIT.
> * Field names in the answer are camelCase (metrics.costMicros) though the query writes them snake\_case.

### Run a GAQL report and get every row at once

POST

`/customers/{customer_id}/googleAds:searchStream`

`google-ads.query_stream`

The same query as google-ads.query, returned whole with no paging. Suits results that fit in memory: bound it with LIMIT or a date range.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`customer_id` required</td><td>string</td><td>path</td><td>Digits only. Example `1234567890`</td></tr>

    <tr>
      <td>
        `query`

        required
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        GAQL.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/google-ads/api/rest/common/search) · Same job: [Meta Ads (Marketing API)](https://docs.webrouter.net/data-apis/meta-ads.md#meta-ads-insights-get), [Pinterest Ads](https://docs.webrouter.net/data-apis/pinterest-ads.md#pinterest-ads-analytics-account), [Snapchat Ads](https://docs.webrouter.net/data-apis/snapchat-ads.md#snapchat-ads-stats-campaign), [TikTok Ads (Marketing API)](https://docs.webrouter.net/data-apis/tiktok-ads.md#tiktok-ads-report-query)

> [!NOTE]
>
> * The answer is a JSON ARRAY of batches, each with its own results list, unlike every other call's object.

### Look up GAQL fields and resources

POST

`/googleAdsFields:search`

`google-ads.fields.search`

Which fields exist, are selectable, filterable or sortable, and which resources they can be queried with -- the GAQL schema.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>body</td><td>A query over the field metadata. Example `SELECT name, selectable, filterable, data_type WHERE name LIKE 'metrics.%'`</td></tr>

    <tr>
      <td>
        `pageSize`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td />
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/google-ads/api/docs/query/overview)

```python Python theme={null}
router.call_data_api("google-ads.fields.search", {'query': "SELECT name, selectable, filterable, data_type WHERE name LIKE 'metrics.%'"})
```

```text MCP theme={null}
call_data_api(endpoint="google-ads.fields.search", params={"query": "SELECT name, selectable, filterable, data_type WHERE name LIKE 'metrics.%'"})
```

> [!NOTE]
>
> * Needs no customer id and no login-customer-id.

### Get keyword ideas from Keyword Planner

POST

`/customers/{customer_id}:generateKeywordIdeas`

`google-ads.keywords.ideas`

Keyword ideas from seed keywords, a URL or a whole site, with average monthly searches, competition and top-of-page bid ranges.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`customer_id` required</td><td>string</td><td>path</td><td>Digits only; any account you can reach. Example `1234567890`</td></tr>
    <tr><td>`keywordSeed`</td><td>object</td><td>body</td><td>\{keywords: \[...]}. Exactly one seed: keywordSeed, urlSeed, keywordAndUrlSeed or siteSeed. Example `{"keywords": ["coffee beans"]}`</td></tr>

    <tr>
      <td>
        `urlSeed`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td>
        \{url: 'https\://...'}.
      </td>
    </tr>

    <tr>
      <td>
        `keywordAndUrlSeed`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td>
        \{url, keywords: \[...]}.
      </td>
    </tr>

    <tr>
      <td>
        `siteSeed`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td>
        \{site: 'example.com'}.
      </td>
    </tr>

    <tr><td>`language`</td><td>string</td><td>body</td><td>Language resource name; English is languageConstants/1000. Example `languageConstants/1000`</td></tr>
    <tr><td>`geoTargetConstants`</td><td>array</td><td>body</td><td>Up to 10 location resource names; the US is geoTargetConstants/2840. Example `["geoTargetConstants/2840"]`</td></tr>
    <tr><td>`keywordPlanNetwork`</td><td>string</td><td>body</td><td>Unset means GOOGLE\_SEARCH\_AND\_PARTNERS. One of `GOOGLE_SEARCH`, `GOOGLE_SEARCH_AND_PARTNERS`</td></tr>

    <tr>
      <td>
        `includeAdultKeywords`
      </td>

      <td>
        boolean
      </td>

      <td>
        body
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `historicalMetricsOptions`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td>
        \{yearMonthRange: \{start: \{year, month}, end: \{year, month}}} for a monthly series.
      </td>
    </tr>

    <tr>
      <td>
        `aggregateMetrics`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `pageSize`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        At most 10,000.
      </td>
    </tr>

    <tr>
      <td>
        `pageToken`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        nextPageToken from the previous answer; send the same fields.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/google-ads/api/docs/keyword-planning/generate-keyword-ideas) · Same job: [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-matching-terms), [DataForSEO](https://docs.webrouter.net/data-apis/dataforseo.md#dataforseo-labs-keyword-ideas), [Keywords Everywhere](https://docs.webrouter.net/data-apis/keywordseverywhere.md#keywordseverywhere-related-keywords), [Mangools](https://docs.webrouter.net/data-apis/mangools.md#mangools-keywords-related), [Semrush](https://docs.webrouter.net/data-apis/semrush.md#semrush-keyword-related), [SE Ranking](https://docs.webrouter.net/data-apis/seranking.md#seranking-keywords-related)

```python Python theme={null}
router.call_data_api("google-ads.keywords.ideas", {'customer_id': '1234567890', 'keywordSeed': {'keywords': ['coffee beans']}, 'language': 'languageConstants/1000', 'geoTargetConstants': ['geoTargetConstants/2840']})
```

```text MCP theme={null}
call_data_api(endpoint="google-ads.keywords.ideas", params={"customer_id": "1234567890", "keywordSeed": {"keywords": ["coffee beans"]}, "language": "languageConstants/1000", "geoTargetConstants": ["geoTargetConstants/2840"]})
```

> [!NOTE]
>
> * Bids are in micros. Accounts with no spend history get bucketed search volumes.

### Get search volume and bids for a keyword list

POST

`/customers/{customer_id}:generateKeywordHistoricalMetrics`

`google-ads.keywords.historical_metrics`

Average monthly searches, competition and top-of-page bid range for up to 10,000 keywords you name.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`customer_id` required</td><td>string</td><td>path</td><td>Digits only. Example `1234567890`</td></tr>
    <tr><td>`keywords` required</td><td>array</td><td>body</td><td>Up to 10,000 keywords. Example `["coffee beans", "espresso machine"]`</td></tr>

    <tr>
      <td>
        `language`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        &#x20;Example&#x20;

        `languageConstants/1000`
      </td>
    </tr>

    <tr>
      <td>
        `geoTargetConstants`
      </td>

      <td>
        array
      </td>

      <td>
        body
      </td>

      <td>
        &#x20;Example&#x20;

        `["geoTargetConstants/2840"]`
      </td>
    </tr>

    <tr>
      <td>
        `keywordPlanNetwork`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        &#x20;One of&#x20;

        `GOOGLE_SEARCH`

        ,&#x20;

        `GOOGLE_SEARCH_AND_PARTNERS`
      </td>
    </tr>

    <tr>
      <td>
        `includeAdultKeywords`
      </td>

      <td>
        boolean
      </td>

      <td>
        body
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `historicalMetricsOptions`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `aggregateMetrics`
      </td>

      <td>
        object
      </td>

      <td>
        body
      </td>

      <td />
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.google.com/google-ads/api/docs/keyword-planning/generate-historical-metrics) · Same job: [Ahrefs](https://docs.webrouter.net/data-apis/ahrefs.md#ahrefs-keywords-overview), [Bing Webmaster Tools](https://docs.webrouter.net/data-apis/bing-webmaster.md#bing-webmaster-keywords-stats), [DataForSEO](https://docs.webrouter.net/data-apis/dataforseo.md#dataforseo-keywords-google-ads-volume), [Keywords Everywhere](https://docs.webrouter.net/data-apis/keywordseverywhere.md#keywordseverywhere-keyword-data), [Semrush](https://docs.webrouter.net/data-apis/semrush.md#semrush-keyword-overview-all-databases), [SE Ranking](https://docs.webrouter.net/data-apis/seranking.md#seranking-keywords-export)

```python Python theme={null}
router.call_data_api("google-ads.keywords.historical_metrics", {'customer_id': '1234567890', 'keywords': ['coffee beans', 'espresso machine'], 'language': 'languageConstants/1000', 'geoTargetConstants': ['geoTargetConstants/2840']})
```

```text MCP theme={null}
call_data_api(endpoint="google-ads.keywords.historical_metrics", params={"customer_id": "1234567890", "keywords": ["coffee beans", "espresso machine"], "language": "languageConstants/1000", "geoTargetConstants": ["geoTargetConstants/2840"]})
```

> [!NOTE]
>
> * Close variants are merged, so fewer rows can come back than keywords were sent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.