Lists the ad groups of a Google Ads account with campaign, status, type, CPC bid and impressions, clicks, cost and conversions for a date range.
curl -X POST "https://api.primaryapi.com/v1/run/google-ads.ad_groups" \
-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,
"adGroups": [
{
"name": "Brand terms",
"cpcBid": 1.5,
"cpcBidMicros": 1500000,
"effectiveCpcBid": 1.5, …
}
], …
}
},
"credits": 1
}Input and output
10 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.
Sorted by cost, highest first.
Narrow to one campaign with campaignId.
Manager accounts have no ad groups of their own. Query a client account, passing the manager id as loginCustomerId.
Unknown customer ID? It comes back as not found, not as an error.
The same key and credits work for every API.