MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Google Search Console API
8 Google Search Console endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Search & SEO · 8 endpoints · from 1 credit per call
Endpoints
- POSTSearch Console Add Property
/v1/run/search-console.add_siteAdds a website or domain property to the connected Search Console account (a change to the account).1 creditper call - POSTSearch Console Delete Sitemap
/v1/run/search-console.delete_sitemapRemoves a submitted sitemap from a Search Console property (a change to the connected account).1 creditper call - POSTSearch Console Performance
/v1/run/search-console.performanceClicks, impressions, CTR and average position from Google Search for a Search Console property, grouped by query, page, country, device or date.1 creditper call - POSTSearch Console Properties
/v1/run/search-console.sitesLists the Search Console properties of the connected Google account with its permission level on each one.1 creditper call - POSTSearch Console Remove Property
/v1/run/search-console.delete_siteRemoves a property from the connected Search Console account (a change to the account; needs confirm: true).1 creditper call - POSTSearch Console Sitemaps
/v1/run/search-console.sitemapsLists the sitemaps submitted for a Search Console property with their status, last download, error counts and URLs submitted.1 creditper call - POSTSearch Console Submit Sitemap
/v1/run/search-console.submit_sitemapSubmits a sitemap to Google for a Search Console property (a change to the connected account).1 creditper call - POSTSearch Console URL Inspection
/v1/run/search-console.inspect_urlInspects one URL of a Search Console property: whether Google has indexed it, why not, its last crawl, canonical and rich results.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, search-console.add_site:
curl -sS -X POST "https://api.primaryapi.com/v1/run/search-console.add_site" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"siteUrl":"https://shop.example.org/"}'const res = await fetch('https://api.primaryapi.com/v1/run/search-console.add_site', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
siteUrl: 'https://shop.example.org/',
}),
});
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/search-console.add_site",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"siteUrl": "https://shop.example.org/",
},
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.