Google Search Console API: Extracting Data Step by Step

Quick answer
The Google Search Console API lets you automatically extract clicks, impressions, CTR and position data by query, page or country. You call the Search Analytics endpoint with an authenticated request (OAuth 2.0 or service account), then receive workable JSON. This method automates reporting and feeds your SEO workflows with fresh data, without manual exports.
Manually exporting data from the Google Search Console interface quickly becomes limiting: 1,000 rows maximum per export, no combined history, repetitive manipulation. For freelancers, agencies and SEO teams tracking dozens of sites, this friction costs time every week. The Google Search Console API changes that: it provides programmatic access to your performance data, with more depth and the ability to automate extraction. In this tutorial, we detail how to set up access, build an extraction query and use the results. We'll also see how Selfhook queries this API in real time to enrich every content workflow with fresh performance data, with no technical setup on your end. Whether you're a developer or simply curious about automating your reporting, this approach can help make your SEO tracking more reliable and responsive.
Setting Up Access to the Google Search Console API
Before extracting data, you need to enable the API and choose an authentication method. Head to Google Cloud Console, create a project, then enable the "Google Search Console API". Two options exist depending on your case. OAuth 2.0 suits applications acting on behalf of a user, while a service account is generally preferred for server automations. Remember to add the service account email as an authorized user in the relevant Search Console property settings, otherwise access will be denied.
- Create a project in Google Cloud Console
- Enable the Google Search Console API
- Generate OAuth 2.0 credentials or a service account
- Authorize the account in the Search Console property
Building a Data Extraction Query
The main endpoint for extraction is `searchanalytics.query`. You send a POST request containing a date range, dimensions (query, page, country, device, date) and optional filters. The response arrives in JSON format with clicks, impressions, CTR and average position for each row. An important point to measure in Search Console: the API can return more rows than the manual export, but remains subject to quota limits and anonymization of certain rare queries. Combine dimensions based on your analysis needs: for example `query` + `page` to identify which pages rank for which intents.
- Define startDate and endDate
- Choose dimensions (query, page, date...)
- Add filters (country, device type)
- Handle pagination via rowLimit and startRow

Using and Automating Extracted Data
Once the JSON is retrieved, the challenge is turning it into actionable information. You can send it to a database, a Google Sheet, a Looker Studio dashboard or a reporting tool. Automation lets you generally observe trends over several weeks, detect pages losing position and prioritize optimizations. Schedule daily or weekly extraction via cron or an orchestrator. To go further, check out our guides automating-google-search-console and seo-reporting-automation, which detail end-to-end workflows. The goal: replace manual exports with a reliable, reproducible flow, in some cases cutting several hours from monthly reporting work.
- Store data in a database or Sheet
- Visualize in Looker Studio or an internal dashboard
- Schedule recurring extraction
- Cross-reference with other sources (analytics, logs)
Imagine an agency tracking 30 client sites. Every Monday, a script calls the Search Console API with the `query` and `page` dimensions, over a 28-day window, with `rowLimit` set to 25,000. The returned JSON is inserted into BigQuery, then Looker Studio generates a report per client. Typically observed result: what used to take half a day of manual exports and copy-pasting now happens automatically. The team spots pages whose average position slips from 3 to 8 positions week over week, and triggers targeted optimization. The exact time-saving figures vary by topic and page volume, but tracking reliability improves noticeably.

Selfhook queries the Google Search Console API in real time to enrich every SEO workflow with fresh performance data. Concretely, when Selfhook prepares or updates a WordPress piece of content, it retrieves the queries and positions associated with the relevant page, which can help guide Yoast optimization and internal linking. Rather than juggling manual exports and third-party tools, you get an integrated performance view directly within your content production flow. This native connection avoids technical API setup: Selfhook handles authentication and API calls on your behalf.
Key takeaways
The Search Console API surpasses manual export limits (1,000 rows)
OAuth 2.0 or service account depending on your use case
The searchanalytics.query endpoint is the core of extraction
Automate via cron for reproducible reporting
Selfhook queries the API in real time with no setup on your part
Selfhook centralizes content generation, SEO/GEO optimization, WordPress publishing and tracking in a single workflow.
Discover Selfhook →FAQ
Is the Google Search Console API free?
Yes, access to the Google Search Console API is free. However, it is subject to usage quotas per project and per day. For most common SEO uses these limits are sufficient, but massive extraction across many properties may require careful management of calls.
How many rows can you extract via the API?
The API lets you extract far more than the 1,000 rows of the manual export, generally up to 25,000 rows per request through pagination. Some rare queries remain anonymized by Google for privacy reasons, which is to be measured in Search Console.
What's the difference between OAuth and a service account?
OAuth 2.0 acts on behalf of a user who authenticates, ideal for interactive applications. A service account is preferred for server automations without human intervention. In that case, you must explicitly authorize the account in the relevant Search Console property.
How far back does the API keep data?
Like the interface, the Google Search Console API provides access to roughly 16 months of history. To keep data beyond that, it's recommended to extract regularly and store the results in your own database, enabling long-term analysis.
Do you need to code to use the API?
Basic programming knowledge (Python, JavaScript) helps when using the API directly. That said, tools like Selfhook handle the API calls for you, letting you benefit from performance data without any technical setup.
Operational checklist
Conclusion
Mastering the Google Search Console API transforms your SEO tracking: no more limited manual exports, just fresh, deep and automatable data. Whether you manage one site or a client portfolio, programmatic extraction can help make your reporting more reliable and let you react faster to performance shifts. If technical setup holds you back, Selfhook queries this API in real time and integrates performance data directly into your WordPress content workflows, with no manipulation on your end. Start with a first test call, then progressively automate your pipeline to save time on every production cycle.
Ready to automate your SEO content?
Discover how Selfhook can help you create and publish quality SEO content
Start for free