Lists the campaigns of a Google Ads account with status, daily budget and impressions, clicks, cost and conversions for a date range.
curl -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"}'{
"output": {
"found": true,
"data": {
"currencyCode": "USD",
"period": "DURING LAST_30_DAYS",
"nextCursor": null,
"campaigns": [
{
"name": "Brand - Search",
"resourceName": "customers/1234567890/campaigns/111",
"status": "ENABLED",
"primaryStatus": "ELIGIBLE", …
}
], …
}
},
"credits": 1
}Input and output
9 fields
1234567890.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.5 fields
Good to know
Runs as your connected Google account. Needs the Google Ads capability.
Amounts are in the account currency. 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.
Unknown customer ID? It comes back as not found, not as an error.
The same key and credits work for every API.