Rank tracking

Google Search Console API: what it gives you, its limits, and a Python example

The Google Search Console API is free and returns clicks, impressions, CTR and position by query. See its limits, setup steps and a working Python script.

The Google Search Console API lets you pull your site’s Search Console data with code. It is free. You get clicks, impressions, click-through rate and average position for every query and page, plus index checks and sitemap tools.

Use it when the Search Console screen is not enough, usually because it stops at 1,000 rows. Below are the limits, a step-by-step setup and a Python script that saves every query to a CSV file.

What does the Search Console API give you?

The Search Console API gives code access to four parts of Search Console: Search Analytics, URL Inspection, Sitemaps and Sites. Google lists them in its API reference.

ServiceWhat it returnsCommon use
Search AnalyticsClicks, impressions, CTR and average position, grouped by query, page, country, device, date or search appearanceExport all queries, build reports
URL InspectionThe index status of one URL, like the URL Inspection toolCheck that key pages are indexed
SitemapsLists your sitemaps and lets you submit or delete themSubmit sitemaps from a deploy script
SitesLists, adds or removes propertiesManage many sites at once

Most people only need Search Analytics. It is the same data as the Performance report.

Do not confuse it with the Indexing API. That is a separate API, and Google says it only works for pages with job postings or livestream video markup.

Is the Search Console API free?

Yes. Google’s pricing page says all use of the Search Console API is free of charge. It does have usage limits.

Search Console API limits

These come from Google’s docs, checked on October 9, 2026.

LimitValue
Rows you can export from the Search Console screen1,000
Rows per API request1,000 by default, up to 25,000
Rows per day, per site, per search type50,000
Search Analytics calls1,200 per minute per site and per user; 40,000 per minute and 30 million per day per project
URL Inspection calls2,000 per day and 600 per minute per site
How far back data goesThe last 16 months
How fresh the data isUsually 2 to 3 days behind

The 1,000 and 50,000 row limits come from Google’s post on performance data limits. The 25,000 rows per request come from the query reference. The call limits are on the usage limits page.

There is also a second kind of limit, called load. Google says queries grouped by both page and query are the most expensive, and long date ranges cost more than short ones. If you hit “quota exceeded,” wait 15 minutes. If it keeps happening, ask for one day of data at a time.

One more gap: anonymized queries. Google leaves out queries that few people searched over two to three months. Your totals include them, but the query rows do not.

How to set up Search Console API access

You need a verified property in Search Console and a Google account. The setup below uses a service account, which is a robot Google account your script signs in as.

  1. Create a project. Open the Google Cloud console, click the project picker at the top, and choose New project.
  2. Turn on the API. Go to APIs & Services, then Library. Search for “Google Search Console API” and click Enable.
  3. Create a service account. Go to IAM & Admin, then Service accounts, and click Create service account. A name is all it needs.
  4. Download a key. Open the new account, go to Keys, then Add key, then Create new key. Pick JSON. Save the file somewhere safe and never commit it to git.
  5. Add it to Search Console. In Search Console, open Settings, then Users and permissions, then Add user. Paste the service account’s email address. Restricted is enough to read performance data. Pick Full if the script will also inspect URLs or submit sitemaps, as Google’s permissions table shows.
  6. Install the Python client. Run pip install google-api-python-client google-auth.

Only a property owner can add users. If you are not an owner, ask one to do step 5.

Python example: export every query past the 1,000-row limit

This script asks for September 2026, grouped by query and page. It pages through the results 25,000 rows at a time and writes them to a CSV file.

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

KEY_FILE = "service-account.json"
SITE = "sc-domain:example.com"  # or "https://www.example.com/"
SCOPES = ["https://www.googleapis.com/auth/webmasters.readonly"]

creds = service_account.Credentials.from_service_account_file(KEY_FILE, scopes=SCOPES)
gsc = build("searchconsole", "v1", credentials=creds)

rows, start = [], 0
while True:
    body = {
        "startDate": "2026-09-01",
        "endDate": "2026-09-30",
        "dimensions": ["query", "page"],
        "rowLimit": 25000,
        "startRow": start,
    }
    resp = gsc.searchanalytics().query(siteUrl=SITE, body=body).execute()
    batch = resp.get("rows", [])
    rows.extend(batch)
    if len(batch) < 25000:
        break
    start += 25000

with open("gsc-queries.csv", "w", newline="") as f:
    out = csv.writer(f)
    out.writerow(["query", "page", "clicks", "impressions", "ctr_percent", "position"])
    for r in rows:
        query, page = r["keys"]
        out.writerow([query, page, r["clicks"], r["impressions"],
                      round(r["ctr"] * 100, 2), round(r["position"], 1)])

print(f"Saved {len(rows)} rows")

A few notes on the code:

  • SITE must match the property exactly. Domain properties start with sc-domain:. URL properties are the full URL with a slash at the end.
  • keys holds the dimension values in the order you asked for them. Here that is the query, then the page.
  • ctr comes back as a fraction, so the script multiplies by 100.
  • Dates are in Pacific time. Ask for whole past days, and leave the last two or three days out if you want final numbers.

For a large site, grouping by query and page is the most expensive kind of request. Run it one day at a time in a daily job and add each day to your file.

What the API cannot tell you

Search Console data is the best source for clicks. It is weak at telling you where you rank and what the page looked like.

Average position is not a rank you can see. Google defines it as the average position of your topmost result across all impressions. If you were 2 for half the searches and 8 for the rest, the API says 5. Our guide on how to check Google rankings explains the difference in more detail.

The API also has three blind spots:

  1. Only your own site. It shows nothing about the competitors around you.
  2. Only queries where you appeared. A keyword you want but do not rank for will not be in the data.
  3. No page layout. It does not show whether an AI Overview, a map pack or People Also Ask sat above your link.

The third gap hides a common cause of low click-through rates. An AI Overview, ads or a map pack above your link push it down the screen, and Search Console cannot show that. Compare your numbers with our organic CTR benchmarks, and use our guide to calculating click-through rate if your sums look off.

When you need a SERP API instead

A SERP API fetches the live Google results page for a keyword, place and device, and returns it as data. It fills the gaps above.

QuestionSearch Console APISERP API
How many clicks did this query get?YesNo
Where do I rank right now in Chicago, on mobile?No, only an averageYes
Who ranks above me?NoYes
Is there an AI Overview or map pack on the page?NoYes
Where do I rank for a keyword I get no clicks from?Only if you got impressionsYes
What does it cost?FreePaid per search

Most teams use both. Pull clicks and impressions from Search Console each day. Then check the live page for your top queries with a SERP API, and join the two on the query. For thousands of keywords, the setup in tracking rankings in bulk handles the scheduling and storage.

Frequently asked questions

Is the Google Search Console API free?

Yes. Google's pricing page says all use of the Search Console API is free of charge. It does have usage limits, such as 1,200 Search Analytics queries per minute per site.

Do I need Google Search Console to use the API?

Yes. The API only returns data for properties you own or have been added to as a user. You need a verified property in Search Console first, and the account your script uses must be a user on it.

Is there a free Google Search API?

Not for general web results. The Search Console API is free but only covers your own site's performance. Google's Custom Search JSON API is closed to new customers and ends on January 1, 2027.

How far back does Search Console API data go?

About 16 months, the same as the Search Console screen. Older data is gone, so save a copy each month if you want a longer history.

Why doesn't the API return all my queries?

Two reasons. Google hides rare queries to protect privacy, and the API serves at most 50,000 rows per day per site and search type, sorted by clicks. Very large sites can turn on the bulk data export to BigQuery, which holds all performance data except anonymized queries.

Sources and further reading

  1. Google for Developers: Search Console API reference developers.google.com
  2. Google for Developers: Search Analytics query (rowLimit and startRow) developers.google.com
  3. Google for Developers: Search Console API usage limits developers.google.com
  4. Google for Developers: Search Console API pricing developers.google.com
  5. Google for Developers: Query all your search traffic (50K rows, 2 to 3 day delay) developers.google.com
  6. Google Search Central Blog: Search Console performance data filtering and limits (October 19, 2022) developers.google.com
  7. Search Console Help: Managing owners, users, and permissions support.google.com
  8. Search Console Help: Performance report (average position definition) support.google.com
  9. Search Console Help: About bulk data export to BigQuery support.google.com
  10. Google Analytics Help: Queries report (Search Console keeps 16 months of data) support.google.com

From the team that built it

Put this into practice with the SERP API.

Real-time Google SERP API with AI-ready JSON — 26+ SERP feature types, location and device targeting, 99.9% uptime — full live SERPs at a fraction of the going rate.

Start on the free balance — no card required.