Skip to content

SEO Audits

How to Use APIs for SEO Reporting

No pressure and no sales script. Just honest answers.

Prefer Saad Raza SEO on Google Add this site as a preferred source to see more of my SEO and AI search guides in Google Top Stories.

Add saadrazaseo.com as a preferred source on Google

Short answer: To use APIs for SEO reporting, decide which questions the report must answer, then connect to the sources that hold the data: the Search Console API for clicks and queries, the GA4 Data API for sessions and conversions, and the PageSpeed Insights API for speed. Authenticate with OAuth or an API key, pull the data on a schedule into a sheet or BigQuery, and build the dashboard on top of that stored copy.

25,000Maximum rows a single Search Console Search Analytics request can return (the default is 1,000)Google for Developers, 2026
50,000Rows of Search Analytics data the API exposes per day per search type, sorted by clicksGoogle for Developers, 2025
200,000GA4 Data API core tokens per standard property per day (40,000 per hour)Google for Developers, 2026

This guide is for SEOs, in-house marketers and agency teams who are tired of exporting CSVs every month and pasting them into slides. By the end you will know which APIs are worth connecting, what their real limits are, how to make a first Search Console request, how to store the data so your reports stay consistent, and which mistakes make automated reports quietly wrong.

What an API does in SEO reporting

An API (application programming interface) lets a script or a reporting tool ask a platform for data directly instead of you logging in and clicking export. You send a request to an endpoint, with credentials and parameters such as a date range and dimensions, and the platform returns structured data, usually JSON. Your code or connector then writes that data somewhere you can report from.

For reporting, that changes three things. The numbers are pulled the same way every time, so month-on-month comparisons are fair. You can go beyond interface limits: the Search Console Performance report shows 1,000 rows, while the API returns up to 25,000 per request. And you can join sources, for example Search Console clicks with GA4 conversions on the same landing page, which no single interface does for you. If you are new to the metrics themselves, start with my guide to the Search Console Performance report and come back.

The APIs worth connecting first

Most reports that clients actually read are built from three free Google APIs. Paid tool APIs add competitor and backlink data, but they are optional and priced by usage, so add them only when a report question needs them.

APIWhat it gives your reportAuthenticationLimits to plan around
Search Console API (Search Analytics)Clicks, impressions, CTR and position by query, page, country, device, date, search appearance; also Discover, News, image and videoOAuth 2.0 or a service account added as a user on the propertyUp to 25,000 rows per request, 50,000 rows per day per search type; 1,200 queries per minute per site
GA4 Data APISessions, engaged sessions, key events and revenue by landing page, channel, deviceOAuth 2.0 or a service account with Viewer accessToken quotas: 200,000 per property per day, 40,000 per hour, 10 concurrent requests (standard properties)
PageSpeed Insights APILighthouse lab results plus Chrome UX Report field data for a URLWorks without a key; a key is recommended for automated runsOne URL per call; lab runs vary, so trend several runs rather than single results
Search Console bulk exportDaily performance tables written straight into BigQuerySet up in Search Console settings with a Google Cloud projectAnonymised queries are excluded; BigQuery storage and query costs apply
Third-party tool APIs (Ahrefs, Semrush, Moz, DataForSEO)Rankings, backlinks, competitor visibility, SERP featuresAPI keyPaid by units or credits; check plan limits before scheduling daily pulls

The row and quota figures come from Google’s Search Analytics query reference, its usage limits page and the GA4 Data API quotas. Google’s own PageSpeed Insights API documentation also notes that it plans to stop including Chrome UX Report field data in that API, so if field data matters to your report, plan to get it from the CrUX API or BigQuery dataset instead. For what those speed numbers mean, see my guide to Core Web Vitals.

Rather have an expert do this for you?

Hand it over and get back to running your business.

Hand it over to me

Start with the questions, not the endpoints

When I take over an agency’s reporting, the problem is rarely the code. It is a dashboard with forty charts and nobody able to say whether things went well. Before writing any request, list the questions the report must answer each month, then map each one to a source and a dimension:

  • Are we getting more non-brand search traffic? Search Console clicks by query, with a brand filter.
  • Which pages gained or lost? Search Console clicks by page, this period against the same period last year.
  • Is organic traffic turning into leads? GA4 key events by landing page for the Organic Search channel.
  • Which keywords are close to page one? Search Console queries with average position 8 to 20, the approach in my guide to striking-distance keywords.
  • Did a release slow the site down? PageSpeed Insights results for key templates, run on a schedule.

That list becomes your specification. Anything not on it stays out of the report. My broader guide to tracking SEO performance with free tools covers which metrics are worth reporting at all.

How to pull Search Console data with the API

  1. Create a Google Cloud project and enable the Google Search Console API.
  2. Choose authentication. For a script that runs unattended, create a service account and add its email address as a user on the Search Console property. For a tool that acts on behalf of different people, use OAuth 2.0.
  3. Send a query to the searchAnalytics.query method with a date range, dimensions and a row limit.
  4. Page through results by raising startRow by 25,000 until a response comes back with no rows, as Google’s guide to getting all your data describes.
  5. Store each day’s rows with the date as a column, so you never need to re-pull history.
Worked example: a Python request for one day of query and page data
from google.oauth2 import service_account
from googleapiclient.discovery import build

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

rows, start = [], 0
while True:
    body = {"startDate": "2026-09-01", "endDate": "2026-09-01",
            "dimensions": ["date", "query", "page"],
            "type": "web", "rowLimit": 25000, "startRow": start}
    resp = gsc.searchanalytics().query(
        siteUrl="sc-domain:example.com", body=body).execute()
    batch = resp.get("rows", [])
    if not batch:
        break
    rows.extend(batch)
    start += 25000

print(len(rows), "rows")

Pull one day per request rather than a whole month. Because the 50,000-row cap applies per day, daily requests return far more of the long tail than a single monthly request, which is capped and sorted by clicks. Store the results and build monthly totals from your stored copy.

Two details catch people out. First, Search Console data is typically available after two to three days, so a job that runs every morning for “yesterday” will save empty or partial data unless you set dataState to “all” on purpose and accept that fresh figures can change. Second, the query dimension drops anonymised queries, so totals by query will always be lower than totals by page or by property. Report site totals from a query without the query dimension.

Where to store and show the data

Pick the simplest setup that answers your questions. These are the three I use, depending on site size.

SetupSuitsStrengthsWatch out for
Looker Studio with native connectorsSmall sites, one or two peopleNo code, free, quick to shareRow limits, slow dashboards on large properties, no history beyond what the source keeps
Script into Google SheetsSmall agencies, monthly client reportsCheap, transparent, easy to check by handSheets slow down with hundreds of thousands of rows
Search Console bulk export plus GA4 export into BigQueryLarge sites, many properties, data teamsFull daily history, SQL joins, no API pagingNeeds a billing account and SQL; costs grow with query volume

Search Console only keeps a limited window of performance history, so whichever setup you choose, start storing early. A year from now you will want the comparison. If your reports feed decisions about content and priorities, my guide to data-driven SEO explains how to turn the stored data into tests rather than charts.

API reporting setup checklist

  • Write the report questions: five to eight questions the report must answer every month.
  • Map each question to a source: Search Console, GA4, PageSpeed Insights or a paid tool.
  • Create a Google Cloud project: enable only the APIs you need.
  • Use a service account for scheduled jobs: add it with read-only access to each property.
  • Keep keys out of code: store credentials in environment variables or a secret manager, never in a shared sheet or repository.
  • Pull one day at a time: page through results with startRow until a response returns no rows.
  • Allow for the data delay: pull days that are at least three days old, or flag fresh data as provisional.
  • Store raw daily rows: keep date, dimensions and metrics so history never depends on the source.
  • Add a brand filter: separate brand and non-brand queries with a written, reusable rule.
  • Annotate changes: log releases, migrations and Google updates next to the data.
  • Check totals against the interface: compare one month with Search Console and GA4 by hand before trusting the dashboard.
  • Handle errors and retries: back off and retry on 429 and 5xx responses, and alert someone when a job fails.

Ticks are saved in your browser.

Mistakes that make automated reports wrong

An automated report can be wrong every month and nobody notices, because nobody is clicking export any more. These are the problems I find most often when I review reporting setups:

  • Summing average position. Position is an impression-weighted average. Adding or averaging it across rows gives a meaningless number; recalculate it weighted by impressions.
  • Mixing property types. A URL-prefix property and a domain property for the same site return different totals. Pick one and say which in the report.
  • Comparing different date ranges. A 31-day month against a 30-day month, or a period that includes a holiday against one that does not, without saying so.
  • Silent failures. A token expires, the job writes nothing, and the chart shows a drop that never happened. Log every run and alert on empty pulls.
  • Reporting paid tool estimates as fact. Third-party traffic and volume figures are modelled. Label them as estimates and keep Search Console as the source of truth for your own site.
  • No context for drops. A fall in clicks during a core update, a migration or an indexing problem means different things. Add annotations, and use real-time SEO monitoring for problems that cannot wait a month.

A note for agencies in Pakistan

Many agencies here report to clients in the UK, US and Gulf. Two small settings save arguments later: run scheduled jobs in UTC and convert only for display, because Google says the Performance report records daily data according to local time in California; and if you join GA4 revenue, confirm the currency set on the property before comparing clients. When you tag campaign links that send traffic to a site, a consistent scheme from a UTM builder keeps the GA4 side of the join clean.

Do you need code at all?

Not always. If one person reports on one site, the native Looker Studio connectors for Search Console and GA4 are enough, and Google’s own interfaces answer most questions. Code becomes worth it when you have many properties, need more than 1,000 rows, want history beyond what Search Console keeps, or want to join sources by landing page. No-code connectors and tools such as Zapier sit in between: they handle authentication and scheduling for you, but you give up control over paging and storage, so check their row limits before relying on them for large sites. For keyword research data and competitor tracking, the paid tools’ own exports are often cheaper than building on their APIs until you need data at scale.

Frequently asked questions

What is an SEO API?

It is an interface that lets software request SEO data, such as search queries, rankings, backlinks or page speed results, from a platform without using its website. Google provides free APIs for Search Console, GA4 and PageSpeed Insights; tools like Ahrefs, Semrush, Moz and DataForSEO sell API access.

Is the Google Search Console API free?

Yes. There is no charge for the API itself, but it has usage limits: up to 25,000 rows per request, 50,000 rows per day per search type for Search Analytics, and per-minute query limits per site, per user and per project. Bulk export to BigQuery is also free to set up, but BigQuery storage and queries can cost money.

How do I get more than 1,000 rows from Search Console?

Use the API with rowLimit set to 25,000 and page through results with startRow, request one day at a time, or set up the bulk export to BigQuery, which writes daily tables without paging. The Performance report in the interface is capped at 1,000 rows.

Why don’t my API totals match the Search Console interface?

Usually because the request groups by query or page. Grouping by query removes anonymised queries, and grouping by page changes how clicks are counted. Request totals without those dimensions, use the same property, search type and date range, and allow for the two to three day data delay.

Can I automate SEO reports without coding?

Yes. Looker Studio’s native connectors cover Search Console and GA4, and connector services can schedule pulls into Sheets. Coding becomes useful for large sites, many properties, long-term storage or joining several sources by URL.

How often should an automated SEO report run?

Store data daily, because that keeps the long tail and protects history, but report monthly to stakeholders. Weekly or daily dashboards are useful for monitoring releases and migrations, not for judging strategy.

Sources

  • Google for Developers, “Search Analytics: query” (Search Console API reference, last updated 2026).
  • Google for Developers, “Getting all your data” (Search Console API guide, last updated 2025).
  • Google for Developers, “Google Analytics Data API quotas” (last updated 2026).
  • Google for Developers, “Get started with the PageSpeed Insights API” (last updated 2025).

If you would like a reporting setup checked, or want help deciding which numbers your client reports should include, my SEO audit service covers analytics and tracking, or you can get in touch with your question.

Rather have an expert do this for you?

Tell me about your website and goals, and I will reply with a free first review.

Your details are only used to reply to your request. No spam.

Grow my trafficCall