MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Google Ads API
10 Google Ads endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Search & SEO · 10 endpoints · from 1 credit per call
Endpoints
- POSTGoogle Ads Accounts
/v1/run/google-ads.accountsLists the Google Ads accounts the connected Google account can open, with name, currency, time zone, status and whether each is a manager account.1 creditper call - POSTGoogle Ads Ad Groups
/v1/run/google-ads.ad_groupsLists the ad groups of a Google Ads account with campaign, status, type, CPC bid and impressions, clicks, cost and conversions for a date range.1 creditper call - POSTGoogle Ads Ads
/v1/run/google-ads.adsLists the ads of a Google Ads account with type, final URLs, responsive search ad headlines, status, policy approval and clicks, cost and conversions for a date range.1 creditper call - POSTGoogle Ads Campaign Performance by Day
/v1/run/google-ads.campaign_performanceReturns one row per campaign per day for a Google Ads account: impressions, clicks, spend, conversions and conversion value, with money in micros of the account currency.1 creditper call - POSTGoogle Ads Campaigns
/v1/run/google-ads.campaignsLists the campaigns of a Google Ads account with status, daily budget and impressions, clicks, cost and conversions for a date range.1 creditper call - POSTGoogle Ads Keywords
/v1/run/google-ads.keywordsLists the keywords of a Google Ads account with match type, status, Quality Score, bid and impressions, clicks, cost and conversions for a date range.1 creditper call - POSTGoogle Ads Pause or Enable Campaign
/v1/run/google-ads.set_campaign_statusPauses or enables a Google Ads campaign (a change to the connected ad account that starts or stops spend); supports validateOnly.1 creditper call - POSTGoogle Ads Query (GAQL)
/v1/run/google-ads.queryRuns a read-only Google Ads Query Language (GAQL) report on a Google Ads account: any resources, fields, segments and metrics.1 creditper call - POSTGoogle Ads Search Terms
/v1/run/google-ads.search_termsLists what people searched for before seeing a Google Ads account’s search ads, with the keyword that matched, match type and clicks, cost and conversions for a date range.1 creditper call - POSTGoogle Ads Update Campaign Budget
/v1/run/google-ads.update_campaign_budgetChanges the average daily budget of a Google Ads campaign, in the account currency (a change to the connected ad account that changes spend); supports validateOnly.1 creditper call
Calling them
Every endpoint on this page is one POST to https://api.primaryapi.com/v1/run/{sku} with your API key and a JSON body. Responses share one envelope, so code written for one endpoint handles the others. For example, google-ads.accounts:
curl -sS -X POST "https://api.primaryapi.com/v1/run/google-ads.accounts" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch('https://api.primaryapi.com/v1/run/google-ads.accounts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/google-ads.accounts",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"])New to PrimaryAPI? Start with the Quickstart, then read Making requests.