# Google Ads Campaigns (`google-ads.campaigns`)

Lists the campaigns of a Google Ads account with status, daily budget and impressions, clicks, cost and conversions for a date range.

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

- Endpoint: `POST https://api.primaryapi.com/v1/run/google-ads.campaigns`
- 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.campaigns`
- 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. |
| `statuses` | enum[] | no | ["ENABLED","PAUSED"] | min 1 items; max 3 items | Campaign statuses to include (default ENABLED and PAUSED). |
| `limit` | integer | no | 50 | 1–1000 | Maximum number of results to return (1-1000, default 50). |
| `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" |
| `campaigns` | object[] |  |
| `campaigns[].id` | string |  |
| `campaigns[].resourceName` | string |  |
| `campaigns[].name` | string \| null |  |
| `campaigns[].status` | string \| null | ENABLED, PAUSED or REMOVED (what you set) |
| `campaigns[].primaryStatus` | string \| null | ELIGIBLE, PAUSED, REMOVED, ENDED, PENDING, MISCONFIGURED, LIMITED, LEARNING or NOT_ELIGIBLE (why it serves or not) |
| `campaigns[].servingStatus` | string \| null | SERVING, NONE, ENDED, PENDING or SUSPENDED |
| `campaigns[].channelType` | string \| null | SEARCH, DISPLAY, SHOPPING, VIDEO, PERFORMANCE_MAX, DEMAND_GEN, … |
| `campaigns[].biddingStrategyType` | string \| null |  |
| `campaigns[].startDateTime` | string \| null |  |
| `campaigns[].endDateTime` | string \| null |  |
| `campaigns[].budget` | object \| null |  |
| `campaigns[].budget.id` | string \| null |  |
| `campaigns[].budget.amount` | number \| null | Daily budget in the account currency |
| `campaigns[].budget.amountMicros` | integer \| null |  |
| `campaigns[].budget.shared` | boolean \| null | An explicitly shared budget (used by several campaigns) |
| `campaigns[].metrics` | object |  |
| `campaigns[].metrics.impressions` | integer \| null |  |
| `campaigns[].metrics.clicks` | integer \| null |  |
| `campaigns[].metrics.cost` | number \| null | In the account currency |
| `campaigns[].metrics.costMicros` | integer \| null |  |
| `campaigns[].metrics.conversions` | number \| null |  |
| `campaigns[].metrics.conversionsValue` | number \| null |  |
| `campaigns[].metrics.ctr` | number \| null |  |
| `campaigns[].metrics.averageCpc` | number \| null | cost ÷ clicks, in the account currency |
| `nextCursor` | string \| null |  |

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.campaigns" \
  -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",
      "campaigns": [
        {
          "id": "111",
          "resourceName": "customers/1234567890/campaigns/111",
          "name": "Brand - Search",
          "status": "ENABLED",
          "primaryStatus": "ELIGIBLE",
          "servingStatus": "SERVING",
          "channelType": "SEARCH",
          "biddingStrategyType": "TARGET_CPA",
          "startDateTime": "2026-01-05 00:00:00",
          "endDateTime": null,
          "budget": {
            "id": "9001",
            "amount": 50,
            "amountMicros": 50000000,
            "shared": false
          },
          "metrics": {
            "impressions": 12904,
            "clicks": 842,
            "cost": 412.5,
            "costMicros": 412500000,
            "conversions": 38,
            "conversionsValue": 4180.5,
            "ctr": 0.0652511,
            "averageCpc": 0.489905
          }
        }
      ],
      "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.campaigns`

## 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). Amounts are in the account currency (currencyCode); budgets are daily. Sorted by cost, highest first. Manager accounts have no campaigns of their own: query a client account, passing the manager id as loginCustomerId. Change a campaign with google-ads.set_campaign_status or google-ads.update_campaign_budget.

