Google Search Console API: What It Automates

The Google Search Console API reads performance data, sitemaps and URL Inspection results. What it automates, its limits, Python setup and what it can't do.

Google Search Console API: What It Automates

The Google Search Console API is Google's free programming interface to your Search Console data. With it, a script can pull clicks, impressions, CTR and average position from the Performance report, list and submit sitemaps, list the properties you can access, and read the URL Inspection result (index status, last crawl, canonical) for any URL in a property you have access to. It uses OAuth 2.0, costs nothing and has quotas, the tightest being 2,000 URL inspections per property per day. What it cannot do: there is no Request Indexing endpoint, so no API call asks Google to crawl or index a page.

Below: every part of the API and what it automates, the limits that matter, how to set up access step by step, working Python code, what the URL Inspection API returns, and what those fields showed across 1.1 million sitemap URLs.

What can you do with the Google Search Console API?

The Search Console API (often shortened to "GSC API") has four parts. Three live under the older webmasters/v3 address and URL Inspection under searchconsole/v1, but one set of credentials works for all of them.

Part of the APIMethodsWhat you can automate
Search AnalyticsqueryClicks, impressions, CTR and average position, grouped by query, page, country, device, date or search appearance: the data behind the Performance report.
Sitemapslist, get, submit, deleteEvery sitemap Google knows for a property, with its last download and errors. Submit a new sitemap or remove an old one.
Siteslist, get, add, deleteEvery property your Google account can access, with your permission level on each.
URL Inspectionindex.inspectThe indexed status of one URL: coverage state, last crawl time, robots.txt and noindex state, user-declared and Google-selected canonical, sitemaps and referring URLs.

What people build on top of it:

  • Performance reporting. Pull Search Analytics data into BigQuery, Looker Studio or a spreadsheet every day. The browser report exports up to 1,000 rows per table; the API returns up to 25,000 rows per request.
  • Index monitoring. Inspect your important URLs on a schedule and alert when one drops out of the index, stops being crawled or gets a different Google-selected canonical.
  • Sitemap housekeeping. Submit sitemaps for many properties at once and flag the ones with errors. Our guide on how to submit a sitemap to Google covers the same job in the browser.
  • Agency dashboards. Loop through every property in the Sites list and build one report.

What the Search Console API cannot do

The API reads data and manages sitemaps. It cannot change how Google crawls or indexes your pages, and several reports have no endpoint:

  • No Request Indexing. No method presses the Request indexing button. URL Inspection in the API is read-only.
  • No live test. Google's reference for the inspect method says: "Presently only the status of the version in the Google index is available; you cannot test the indexability of a live URL." Test live URL exists only in the web interface.
  • No Page indexing report. No endpoint returns the indexed and not indexed totals or the list of URLs per reason. You inspect URLs one at a time.
  • No Links, Crawl stats, Core Web Vitals, Manual actions or Removals. Those reports stay in the browser. Core Web Vitals field data lives in Google's separate Chrome UX Report API.
  • No user management. Owners add and remove users in Settings > Users and permissions.

Google does have a separate Indexing API that accepts URL notifications, but its quickstart is explicit: "The Indexing API can only be used to crawl pages with either JobPosting or BroadcastEvent embedded in a VideoObject." That means job postings and livestream videos, not ordinary pages. For a wider view of what Search Console itself does and doesn't do, see our guide to what Google Search Console is.

Search Console API limits and quotas

These are the usage limits from Google's Search Console API documentation. "Per site" means per property; "per project" means per Google Cloud project, whatever the number of users.

Part of the APIScope of the limitLimit
URL InspectionPer site (property)2,000 queries per day, 600 per minute
URL InspectionPer project10,000,000 queries per day, 15,000 per minute
Search AnalyticsPer site (property)1,200 queries per minute
Search AnalyticsPer user1,200 queries per minute
Search AnalyticsPer project30,000,000 queries per day, 40,000 per minute
Sites and SitemapsPer user20 queries per second, 200 per minute
Sites and SitemapsPer project100,000,000 queries per day

Search Analytics has data limits on top of the request quotas:

  • 25,000 rows per request. Set rowLimit to 25,000 and page with startRow. Repeat the query with startRow raised by 25,000 until a response comes back with no rows.
  • 50,000 rows per day per search type. Google's guide to getting all your data says the API "exposes a maximum of 50K rows of data per day per search type", sorted by clicks. Long-tail queries beyond that are not in the API.
  • Load quota. Expensive queries, such as grouping by page and query over a long date range, count against a separate load quota. If you hit it, narrow the date range or drop a dimension.
  • Fresh data is preliminary. Data typically arrives after 2 to 3 days. The default returns only final data; "dataState": "all" adds the fresh days, which can still change.
  • History. The API reaches back as far as the Performance report: 16 months.

For most sites, the limit that bites is URL Inspection's 2,000 a day. Our own data below shows which sites run into it.

Do you need a Google Search Console API key?

No. An API key alone cannot open Search Console data, because that data belongs to a verified site owner. Google's authorization guide says: "Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported." You authorize in one of two ways:

  • OAuth client ID. A person signs in with Google and approves access once. The token carries that person's Search Console permissions. Use it for scripts you run yourself, or for apps where users connect their own Search Console.
  • Service account. A robot Google account for servers and scheduled jobs. It sees nothing until you add its email address as a user on each property.

Both use one of two scopes: webmasters.readonly for read-only access, or webmasters for read and write access, which you need to submit or delete sitemaps and add sites.

How to set up the Search Console API, step by step

This setup uses a service account, the usual choice for a script that runs on a schedule.

  1. Open the Google Cloud console. In the project selector at the top, pick a project or click New project.
  2. Go to APIs & Services > Library, search for Google Search Console API, open it and click Enable.
  3. Go to APIs & Services > Credentials, click Create credentials and choose Service account. Give it a name and finish the wizard. No project roles are needed.
  4. Open the new service account, go to the Keys tab, click Add key > Create new key, choose JSON and click Create. A key file downloads. Keep it out of your code repository.
  5. Copy the service account's email address. It ends in iam.gserviceaccount.com.
  6. In Google Search Console, open the property and go to Settings > Users and permissions. Click Add user, paste the email, choose a permission and click Add. Full covers everything in this guide; Restricted is view-only and cannot submit sitemaps. Only owners see this page.
  7. Repeat step 6 for every property the script should read.

To run a script as yourself instead, choose OAuth client ID in step 3 with the application type Desktop app, and skip steps 4 to 7. Google asks you to set up the consent screen first. The first run opens a browser window where you approve access, and the script then sees every property your account can see.

One detail trips up most first attempts: the siteUrl must match the property exactly. A Domain property is written sc-domain:example.com. A URL-prefix property is the full address with a trailing slash, such as https://www.example.com/.

Google Search Console API with Python

Google's Python client covers all four parts of the API. Install it with pip install google-api-python-client google-auth, then:

from google.oauth2 import service_account
from googleapiclient.discovery import build

SCOPES = ["https://www.googleapis.com/auth/webmasters.readonly"]
creds = service_account.Credentials.from_service_account_file(
    "service-account.json", scopes=SCOPES
)
service = build("searchconsole", "v1", credentials=creds)

SITE = "sc-domain:example.com"

# 1. Properties this account can access
for site in service.sites().list().execute().get("siteEntry", []):
    print(site["siteUrl"], site["permissionLevel"])

# 2. Top pages by clicks for October
report = service.searchanalytics().query(
    siteUrl=SITE,
    body={
        "startDate": "2026-10-01",
        "endDate": "2026-10-31",
        "dimensions": ["page"],
        "rowLimit": 25000,
    },
).execute()
for row in report.get("rows", []):
    print(row["keys"][0], row["clicks"], row["impressions"])

# 3. Sitemaps Google knows about
for sitemap in service.sitemaps().list(siteUrl=SITE).execute().get("sitemap", []):
    print(sitemap["path"], sitemap.get("lastDownloaded"))

# 4. Index status of one URL
result = service.urlInspection().index().inspect(
    body={"inspectionUrl": "https://example.com/pricing", "siteUrl": SITE}
).execute()
status = result["inspectionResult"]["indexStatusResult"]
print(status["coverageState"], status.get("lastCrawlTime", "never crawled"))

Use .get() for optional fields: the API leaves a field out instead of sending it empty, so a URL Google never crawled has no lastCrawlTime at all. Space URL Inspection calls out (600 per minute is the ceiling) and back off when Google answers HTTP 429. In Node.js, the googleapis package exposes the same methods through google.searchconsole("v1").

What does the URL Inspection API return?

The URL Inspection API returns the same data as the Page indexing section of the URL Inspection tool in Search Console, for the indexed version of the page only. The main fields, from Google's reference:

FieldValuesWhat it tells you
verdictPASS, NEUTRAL, FAILPASS is Valid in Search Console, NEUTRAL is Excluded, FAIL is Error.
coverageStateText, such as Submitted and indexedThe same reason the Page indexing report shows.
lastCrawlTimeTimestampLast crawl by Google's primary crawler. Absent if Google never crawled the URL successfully.
robotsTxtStateALLOWED, DISALLOWEDWhether robots.txt blocks Googlebot.
indexingStateINDEXING_ALLOWED, BLOCKED_BY_META_TAG, BLOCKED_BY_HTTP_HEADERWhether a noindex rule blocks indexing, and where it sits.
pageFetchStateSUCCESSFUL, SOFT_404, NOT_FOUND, SERVER_ERROR and moreWhat happened when Google fetched the page.
userCanonical, googleCanonicalURLsThe canonical you declared and the one Google chose.
sitemap, referringUrlsLists of URLsSitemaps that list the URL and pages that link to it.
crawledAsMOBILE, DESKTOPWhich Googlebot crawled the page.

The response also carries inspectionResultLink, a link to the same result in Search Console, plus rich results and AMP checks. Our URL Inspection tool guide explains how these fields read in the web interface and what to do about each one.

What the API returned for 1.1 million sitemap URLs

We looked at the sites connected to IndexMachine: on October 31, 2026, about 1.17 million sitemap URLs on 1,513 sites, 1,136,811 of them with a URL Inspection result. Here is how three fields came back. Aggregate counts only, with no site or URL named; each count is the page's latest inspection, so some are weeks old, and these sites lean toward indexing trouble (their owners signed up for an indexing tool). Most of these sites are on free accounts, where IndexMachine has not requested anything yet, so the numbers show where sites stand before indexing is turned on.

FieldValue returnedSitemap URLsShare of 1,136,811
coverageStateSubmitted and indexed, or Indexed, though blocked by robots.txt329,95629.0%
lastCrawlTimeAbsent: never crawled690,41260.7%
indexingStateINDEXING_STATE_UNSPECIFIED713,85062.8%
indexingStateINDEXING_ALLOWED410,47336.1%
indexingStateBLOCKED_BY_META_TAG11,5351.0%
indexingStateBLOCKED_BY_HTTP_HEADER3420.03%

What that means if you write code against the API:

  • UNSPECIFIED is not a block. 687,358 of the 713,850 URLs with an unspecified indexing state (96.3%) had no lastCrawlTime either. Google reports no indexing state because it never fetched the page. Treat it as "not crawled yet", not as an error.
  • Never crawled is the normal case. 6 in 10 sitemap URLs had no crawl on record. A monitor that only alerts on errors misses most unindexed pages.
  • Noindex comes from the tag, rarely the header. 11,535 URLs were blocked by a robots meta tag and 342 by the X-Robots-Tag header.

The 2,000-a-day quota decides how fresh this kind of data can be. On November 11, 2026, the median site here listed 48 URLs in its sitemap, and 1,423 of the 1,513 sites (94.1%) listed 2,000 or fewer, so one day of quota covers the whole sitemap. The other 90 sites (5.9%) listed about 3.4 million URLs, 93.8% of the total. A sitemap at 50,000 URLs, the most one sitemap file can hold, takes 25 days of quota for one pass over every URL, and 19 of these sites listed more than that. So on big sites a script can't keep every URL fresh, and the pages that fall out of the index are the ones it sees last. IndexMachine keeps track of your index status for you, on every site you connect.

Can the Search Console API request indexing?

No. The Search Console API has no such method, and Google's Indexing API is limited to job posting and livestream pages. For an ordinary page, Google offers two ways to ask: a sitemap, which the API can submit, and the Request indexing button in URL Inspection, which works one URL at a time in the browser and has its own daily quota per property.

This is the gap IndexMachine fills, without code. Sign in with Google and it imports every site you have verified in Search Console and shows the coverage state, last Google crawl, clicks and impressions for every page in your sitemaps. For the part the API cannot do, its Chrome extension presses Google's own Request indexing button in your Search Console every day, on autopilot, for the pages that still need it, using your full daily Google quota on every site. Pages Google already shows as indexed are skipped, so no quota is wasted. Every requested page is tracked until it is on Google, every other engine gets unlimited IndexNow, and you get 404 alerts and a weekly email report. Here is how IndexMachine compares with Google Search Console on its own.

Skip the code: see every page's index status

A free IndexMachine account connects to your Search Console with one Google sign-in and shows the URL Inspection state of every page in your sitemaps. Turn on daily Request Indexing in your own Search Console plus unlimited IndexNow when you are ready.

FAQs

Is the Google Search Console API free?

Yes. Google does not charge for the Search Console API. You need a Google Cloud project to hold the credentials, and usage is capped by quotas instead of billed: for example, 2,000 URL inspections per property per day.

What are the Search Console API limits?

URL Inspection allows 2,000 queries per property per day. Search Analytics allows 1,200 queries per minute per property, returns up to 25,000 rows per request and exposes at most 50,000 rows per day per search type. The full table is above.

How do I use the Google Search Console API with Python?

Install google-api-python-client and google-auth, load a service account key or OAuth credentials, and call build("searchconsole", "v1", credentials=creds). Then use searchanalytics().query() for performance data, sitemaps().list() for sitemaps and urlInspection().index().inspect() for index status. The service account must be added as a user on the property first.

Can I submit URLs for indexing with the Search Console API?

No. The API can submit a sitemap, which tells Google about URLs, but it has no method that requests indexing for a URL. That button exists only in the URL Inspection tool in the browser.

Why does the URL Inspection API return INDEXING_STATE_UNSPECIFIED?

Usually because Google has never crawled the page, so it has nothing to report about noindex rules. In our data, 96.3% of URLs with that state also had no last crawl time. Check coverageState: it will typically say "URL is unknown to Google" or "Discovered - currently not indexed".

Elevate your digital presence

Getting your pages indexed by Google is the first crucial step in your search engine optimization journey.
Fix indexing issues. Let the SEO magic begin.

Try free, see which pages Google hasn't indexed

Free account. Import may take a while for big sites, Google rate-limits Search Console.

See pricing