# Google Ads Keywords (`google-ads.keywords`)

Lists the keywords of a Google Ads account with match type, status, Quality Score, bid and impressions, clicks, cost and conversions for a date range.

Docs: https://primaryapi.com/docs/api-reference/google-ads/keywords

- Endpoint: `POST https://api.primaryapi.com/v1/run/google-ads.keywords`
- Category: Search & SEO · Platform: `google-ads` · Kind: list · Status: live
- Price: 1 credit per call. Every call costs the same, including calls that were retried automatically.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=google-ads.keywords`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `customerId` | string | yes |  | pattern: ^(\d{3})-?(\d{3})-?(\d{4})$ | Google Ads customer (account) id, 10 digits with or without hyphens, e.g. "123-456-7890". List yours with google-ads.accounts. |
| `dateRange` | enum | no | "LAST_30_DAYS" | one of: TODAY, YESTERDAY, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, THIS_MONTH, LAST_MONTH, THIS_WEEK_SUN_TODAY, THIS_WEEK_MON_TODAY, LAST_WEEK_SUN_SAT, LAST_WEEK_MON_SUN | Period of the metrics, in the account’s time zone (default LAST_30_DAYS). Ignored when startDate/endDate are set. |
| `startDate` | string | no |  | pattern: ^\d{4}-\d{2}-\d{2}$ | Custom period start (YYYY-MM-DD), with endDate. |
| `endDate` | string | no |  | pattern: ^\d{4}-\d{2}-\d{2}$ | Custom period end (YYYY-MM-DD), inclusive, with startDate. |
| `limit` | integer | no | 50 | 1–1000 | Maximum number of results to return (1-1000, default 50). |
| `statuses` | enum[] | no | ["ENABLED","PAUSED"] | min 1 items; max 3 items | Keyword statuses to include (default ENABLED and PAUSED). |
| `campaignId` | string | no |  | pattern: ^\d{1,20}$ | Only the keywords of this campaign (numeric id). |
| `adGroupId` | string | no |  | pattern: ^\d{1,20}$ | Only the keywords of this ad group (numeric id, from google-ads.ad_groups). |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |
| `loginCustomerId` | string | no |  | pattern: ^(\d{3})-?(\d{3})-?(\d{4})$ | Only when the connected Google account reaches `customerId` THROUGH a manager (MCC) account: that manager account’s id (10 digits). Sent as the login-customer-id header. Omit for accounts the Google account can open directly. |
| `connection` | string | no |  | max 200 chars | Which connected account to use when the workspace has several for this provider: the customId you gave it (exact), its connection id ("con_…"), its handle (login, email or @handle) or its name. Optional; prefer the customId or id, which never match two accounts. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

| Field | Type | Description |
|---|---|---|
| `customerId` | string |  |
| `currencyCode` | string \| null |  |
| `period` | string | The GAQL date condition used, e.g. "DURING LAST_30_DAYS" |
| `nextCursor` | string \| null |  |
| `keywords` | object[] |  |
| `keywords[].criterionId` | string |  |
| `keywords[].resourceName` | string |  |
| `keywords[].text` | string \| null |  |
| `keywords[].matchType` | string \| null | EXACT, PHRASE or BROAD |
| `keywords[].status` | string \| null | ENABLED, PAUSED or REMOVED |
| `keywords[].primaryStatus` | string \| null | ELIGIBLE, PAUSED, REMOVED, PENDING or NOT_ELIGIBLE |
| `keywords[].approvalStatus` | string \| null | APPROVED, DISAPPROVED, PENDING_REVIEW or UNDER_REVIEW |
| `keywords[].qualityScore` | integer \| null | 1-10; null when Google does not have enough data to score the keyword |
| `keywords[].predictedCtr` | string \| null | Expected click-through rate compared with other advertisers (search_predicted_ctr) |
| `keywords[].creativeQuality` | string \| null | The ad compared with other advertisers (creative_quality_score) |
| `keywords[].landingPageQuality` | string \| null | Landing page quality (post_click_quality_score) |
| `keywords[].cpcBid` | number \| null | Keyword max CPC bid, in the account currency |
| `keywords[].cpcBidMicros` | integer \| null |  |
| `keywords[].effectiveCpcBid` | number \| null |  |
| `keywords[].effectiveCpcBidMicros` | integer \| null |  |
| `keywords[].adGroup` | object |  |
| `keywords[].adGroup.id` | string \| null |  |
| `keywords[].adGroup.name` | string \| null |  |
| `keywords[].campaign` | object |  |
| `keywords[].campaign.id` | string \| null |  |
| `keywords[].campaign.name` | string \| null |  |
| `keywords[].metrics` | object |  |
| `keywords[].metrics.impressions` | integer \| null |  |
| `keywords[].metrics.clicks` | integer \| null |  |
| `keywords[].metrics.cost` | number \| null | In the account currency |
| `keywords[].metrics.costMicros` | integer \| null |  |
| `keywords[].metrics.conversions` | number \| null |  |
| `keywords[].metrics.conversionsValue` | number \| null |  |
| `keywords[].metrics.ctr` | number \| null |  |
| `keywords[].metrics.averageCpc` | number \| null | cost ÷ clicks, in the account currency |

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

Pagination: pass the previous response’s `nextCursor` as `cursor` to get the next page; `nextCursor: null` means there are no more results.

## Example request

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/google-ads.keywords" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customerId":"1234567890"}'
```

## Example response

_Values are placeholders that follow the output schema; `credits` is what this call would cost at the usual price._

```json
{
  "output": {
    "found": true,
    "data": {
      "customerId": "1234567890",
      "currencyCode": "USD",
      "period": "DURING LAST_30_DAYS",
      "keywords": [
        {
          "criterionId": "3331",
          "resourceName": "customers/1234567890/adGroupCriteria/2221~3331",
          "text": "example store",
          "matchType": "PHRASE",
          "status": "ENABLED",
          "primaryStatus": "ELIGIBLE",
          "approvalStatus": "APPROVED",
          "qualityScore": 8,
          "predictedCtr": "ABOVE_AVERAGE",
          "creativeQuality": "ABOVE_AVERAGE",
          "landingPageQuality": "AVERAGE",
          "cpcBid": 1.2,
          "cpcBidMicros": 1200000,
          "effectiveCpcBid": 1.2,
          "effectiveCpcBidMicros": 1200000,
          "adGroup": {
            "id": "2221",
            "name": "Brand terms"
          },
          "campaign": {
            "id": "111",
            "name": "Brand - Search"
          },
          "metrics": {
            "impressions": 2100,
            "clicks": 250,
            "cost": 137.5,
            "costMicros": 137500000,
            "conversions": 12.5,
            "conversionsValue": 1375.25,
            "ctr": 0.1190476,
            "averageCpc": 0.55
          }
        }
      ],
      "nextCursor": null
    }
  },
  "provider": "PrimaryAPI",
  "credits": 1,
  "items": 1,
  "requestId": "req_01JBXK6Y2N9V8T4R3Q2P1M0A7Z",
  "nextCursor": null
}
```

## Pricing and reliability

- Usual price: 1 credit per call
- Price ceiling: the usual price, even when a call is retried. A quote’s `maxCredits` is the most a given call can cost; the `maxCredits` routing control caps it per call
- Live 30-day status, success rate, uptime and latency: `GET https://api.primaryapi.com/v1/status/apis?sku=google-ads.keywords`

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

Runs as your connected Google account and needs the Google Ads capability (ads). Lists the keywords of the keyword report; amounts are in the account currency (currencyCode). Quality Score is today’s score (1-10) with its three parts (predicted CTR, creative and landing page quality, each BELOW_AVERAGE, AVERAGE or ABOVE_AVERAGE), null when Google has too little data. Sorted by cost, highest first. Narrow with campaignId or adGroupId; see what people actually searched with google-ads.search_terms.

