How to Use the Search Console API for SEO Reporting

Data engineer setting up a reporting script at a standing workstation

The Search Console API gives code access to your Google Search Console data. It returns Performance report rows, URL Inspection results and sitemap status for any property your account can open. Google describes the API as free. Usage quotas apply.

This guide sets it up for SEO reporting as of December 2026. It covers enabling the API, choosing between OAuth and a service account, the query parameters and data limits that shape every report, and a working Python script. It ends with the cases where the Search Console MCP or a Data Studio dashboard does the job with less effort.

What can the Search Console API do?

Four API resources matter for SEO reporting. The method list below comes from Google's API discovery document. The permission column comes from Search Console's users and permissions help page.

ResourceMethodsWhat you getPermission to grant
searchanalyticsqueryClicks, impressions, CTR and position by query, page, country, device, date and moreRestricted user (read access)
urlInspection.indexinspectIndex status, canonical choice, last crawl and robots.txt state for one URLRestricted users get fetch-only access in Google's table. We grant Full.
sitemapslist, get, submit, deleteSubmitted sitemaps with errors, warnings and URL countsRestricted user to read. Full user to submit.
siteslist, get, add, deleteThe properties the account can reach and its permission level on eachAny user to list

Two OAuth scopes control access. webmasters.readonly covers every read method. webmasters adds write actions such as sitemap submission. Ask for read-only unless the script submits sitemaps.

Should you use the API, Data Studio, bulk export or an MCP?

Google offers four routes to the same performance data. Each one fits a different job.

RouteBest forLimit to know
Search Console interfaceAd hoc checks and one-off exportsExports stop at 1,000 rows
Data Studio connectorA shared dashboard with no codeSame 50,000-row daily ceiling as the API
Search Console APIScheduled pulls into a sheet, a database or your own tool50,000 rows per day per search type, plus quotas
Bulk data export to BigQueryLarge sites that need every stored rowNeeds a billed Google Cloud project
Search Console MCPAsking questions of the data in a chatInherits the API limits

Google's performance data deep dive confirms the 1,000-row interface cap. It also says the API and the Looker Studio connector share the 50,000-row daily ceiling. Google renamed Looker Studio to Data Studio in April 2026. The bulk export help page says it includes all performance data available to Search Console except anonymized queries. BigQuery storage and query costs apply above the free usage level.

Pick the API when you need data on a schedule in a place you control. Our guide to an SEO dashboard worth opening covers the Data Studio route.

Step 1. Enable the Search Console API

  1. Open the Google Cloud console and create a project, or pick an existing one.
  2. Go to APIs & Services, then Library, and search for Google Search Console API.
  3. Click Enable.

Quotas attach to this project. Google calls it the Developer Console key in the quota tables.

Step 2. Choose OAuth or a service account

Google's authorization guide says requests for private user data must carry an OAuth 2.0 token. Search Console property data falls in that group. No other authorization protocol is supported. Two credential types produce that token.

OAuth client (user sign-in)Service account
Who the requests run asYou, after a browser consent screenA robot account with its own email address
Property accessEvery property your Google account can openOnly properties where you add its email as a user
FitsA script you run by hand on your laptopScheduled jobs on a server or in the cloud
Credential to protectClient secret file and the cached refresh tokenThe JSON private key

For scheduled reporting we'd use a service account. It keeps the job running when the person who set it up leaves.

Create one in the Cloud console under IAM & Admin, then Service Accounts. Add a key of type JSON and download it. Store the file outside your code repository. Anyone holding the key can read every property the account can reach.

Step 3. Add the service account to Search Console

A new service account can't see any property yet. Open the JSON key and copy the client_email value. It ends in iam.gserviceaccount.com.

  1. Open the property in Search Console.
  2. Go to Settings, then Users and permissions. Only property owners see this page.
  3. Click Add user, paste the email and choose a permission level.

Choose Restricted for a reporting job that only reads performance data. Google's prerequisites page says searchAnalytics.query needs read permission. Choose Full if the script submits sitemaps. For URL Inspection, the help page's permission table gives Restricted users fetch-only access. The API reference doesn't state which level index.inspect needs. Try Restricted first and switch to Full if inspection calls are refused. The help page also notes that an email group can't be added as a user.

How does searchAnalytics.query work?

Every performance request is a POST to searchAnalytics.query with a date range and optional grouping. The parameters below come from the method reference.

ParameterValuesNotes
startDate, endDateYYYY-MM-DDRequired. Dates are in Pacific Time and both ends are included.
dimensionsquery, page, country, device, searchAppearance, brandedClassification, date, hourRows group in the order you list them. searchAppearance can't share a request with other dimensions.
typeweb (default), image, video, news, googleNews, discover, webMultimodalOne search type per request
dimensionFilterGroupsOperators equals, notEquals, contains, notContains, includingRegex, excludingRegexRegex uses RE2 syntax. Filters can target a dimension you don't group by.
aggregationTypeauto (default), byPage, byProperty, byNewsShowcasePanelGrouping or filtering by page rules out byProperty
dataStatefinal (default), all, hourly_allall adds fresh data that may still change
rowLimit, startRow1 to 25,000 (default 1,000), zero-based offsetPage by raising startRow until a response returns no rows

Results come back sorted by clicks, highest first. Group by date and they sort by date instead. Each row carries keys, clicks, impressions, ctr and position. CTR is a fraction between 0 and 1.

The dataState default catches people out. Leave it off and you get finalized data only. The most recent days can come back empty. Set all to include fresh data. When you request all grouped by date, the response metadata names the first incomplete date.

What are the Search Console API data limits?

The API returns top rows. Google's reference says it doesn't guarantee to return every row. Four limits shape what you see.

  • 50,000 rows per day per search type. Google's data limits page sets this ceiling, sorted by clicks. A site with a long tail hits it fast once you group by page and query.
  • Anonymized queries. Queries that aren't issued by more than a few dozen users over two to three months never appear as rows. Their clicks still count in totals that don't group by query. Sum your query rows and you'll land below the site total.
  • Dropped detail. Grouping by page or query can drop some data. For accurate totals, Google says to omit the page and query dimensions.
  • 16 months of history. Google's Analytics help states that Search Console keeps data for the last 16 months. Store what you pull if you want year-over-year trends that last.

Google recommends one query per day for one day of data. That stays inside the daily quota and gets the most rows out of the 50,000 ceiling. Data typically lands two to three days after the date it describes.

What are the Search Console API quotas?

Quota figures come from Google's usage limits page, last updated August 28, 2025 and still current as of December 2026.

ResourcePer sitePer userPer project
Search Analytics1,200 queries per minute1,200 queries per minute40,000 per minute and 30,000,000 per day
URL Inspection600 per minute and 2,000 per dayNo separate limit listed15,000 per minute and 10,000,000 per day
Sitemaps and sitesNo separate limit listed20 per second and 200 per minute100,000,000 per day

Load is metered separately for Search Analytics. It's measured in 10-minute and one-day windows. Queries that group or filter by both page and query cost the most. Long date ranges cost more than short ones. If you hit a short-term limit, Google says to wait 15 minutes and spread queries across the day. Every quota error returns the same "quota exceeded" message.

A minimal Search Console API example in Python

This script authenticates with a service account and pulls one day of page and query rows. It pages through results 25,000 rows at a time. It uses Google's API client library for Python and the google-auth package.

pip install google-api-python-client google-auth
from google.oauth2 import service_account
from googleapiclient.discovery import build

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

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


def query_day(day, dimensions):
    rows, start_row = [], 0
    while True:
        body = {
            "startDate": day,
            "endDate": day,
            "dimensions": dimensions,
            "type": "web",
            "rowLimit": 25000,
            "startRow": start_row,
        }
        resp = service.searchanalytics().query(siteUrl=SITE, body=body).execute()
        batch = resp.get("rows", [])
        if not batch:
            return rows
        rows.extend(batch)
        start_row += len(batch)


rows = query_day("2026-11-30", ["page", "query"])
print(len(rows), "rows")
for r in rows[:10]:
    page, query = r["keys"]
    print(page, query, r["clicks"], r["impressions"], round(r["ctr"], 3), round(r["position"], 1))

The siteUrl must match the property string in Search Console. A Domain property uses sc-domain:example.com. A URL-prefix property uses the full URL with its trailing slash. Run service.sites().list().execute() first if you're unsure. It returns every property the account can see along with its permission level.

Write the rows to a table keyed by date and you have a history that outlives the 16-month window. Add a second daily query without page and query dimensions. That one gives the accurate totals to report against.

How to use the URL Inspection API

The index.inspect method returns what Google has stored for one URL. Pass the URL and the property it sits under.

result = service.urlInspection().index().inspect(
    body={"inspectionUrl": "https://example.com/blog/post", "siteUrl": SITE}
).execute()

status = result["inspectionResult"]["indexStatusResult"]
print(status.get("verdict"), status.get("coverageState"), status.get("googleCanonical"))

The index status block includes the verdict, coverage state, last crawl time, robots.txt state, the canonical you declared and the one Google chose. Google's reference says only the indexed version is available. The API can't run a live test.

Quota matters more here than anywhere else. At 2,000 inspections per site per day, a 50,000-URL site needs 25 days to check every URL once. Spend the quota on pages that matter, such as new posts, revenue pages and URLs that dropped out of the performance data. Coverage states map to the reasons in the Page indexing report.

How to use the sitemaps endpoint

The sitemaps resource lists submitted sitemaps and returns each one's last download time, error count, warning count and the number of URLs submitted per content type. The indexed count in that response is deprecated. Use URL Inspection or the Page indexing report for index status.

Submitting a sitemap needs the read-write webmasters scope and Full permission. A check that only reads sitemap errors works with the read-only scope.

Troubleshooting Search Console API errors

SymptomLikely causeFix
403 saying the user lacks permission for the siteThe service account isn't a user on the property, or siteUrl doesn't match the property stringAdd the client_email in Users and permissions. Copy the exact string from sites.list.
403 saying the API is disabled or not used in the projectThe Search Console API isn't enabled in the Cloud project that owns the credentialsEnable it in APIs & Services, then retry after a few minutes
Search Console rejects the email in Add userA typo, or a group addressPaste client_email straight from the JSON key
The last two or three days are missingdataState defaults to final dataSet "dataState": "all"
Query rows sum to less than the site totalAnonymized queries and dropped detailReport totals from a query without page and query dimensions
Rows stop at 50,000 for a dayThe daily data ceilingMove to bulk export, which exports every row except anonymized queries
"Quota exceeded"Load or rate quotaWait 15 minutes, query one day at a time and drop page-plus-query grouping where you can
403 on sitemap submitRead-only scope or Restricted permissionUse the webmasters scope and Full permission

When the Search Console MCP or Data Studio is simpler

A script pays off when the same pull runs every day into storage you own. For exploratory questions, the Search Console MCP calls the same API from a chat window. Our six GSC MCP workflows show the prompts we use. For a dashboard that clients open, the Data Studio connector needs no code. Both inherit the row limits above.

The API is plumbing. What you report on top of it decides whether anyone reads the numbers. Our measurement team builds that layer for clients.

Want this for your brand

See where your brand stands in AI answers today, benchmarked against your competitors, no pitch required.