Google Search Console API: automated data extraction and custom reporting

Module 22: Advanced Wix SEO Strategies | Lesson 251 of 571 | 28 min read

By Michael Andrews, Wix SEO Expert UK

The Google Search Console web interface is useful for quick checks, but it has significant limitations for serious SEO analysis. Data exports are capped at 1,000 rows, date range options are restricted, and there is no way to automate regular data pulls. The Search Console API removes all of these limitations, letting you extract up to 25,000 rows per request, query historical data programmatically, and build automated reporting systems that run on schedule without manual intervention.

How-to infographic showing SEO analytics and reporting including Google Search Console, GA4, rank tracking, monthly reports, ROI tracking, and Looker Studio dashboards
Data-driven reporting transforms raw SEO metrics into actionable insights that prove value and guide your Wix site optimisation strategy.

What the GSC API Can Do That the Web Interface Cannot

The Search Console API provides programmatic access to all the search analytics data available in the web interface, plus capabilities that are exclusive to the API. You can retrieve up to 25,000 rows per request compared to the web interface's 1,000-row export limit. You can combine dimensions like query, page, country, and device in a single request. You can automate daily data pulls to build historical datasets that exceed the 16 months of data available in the web interface.

For Wix site owners who are serious about SEO, the API enables workflows that would be impractical manually. Automated weekly keyword position tracking across hundreds of queries. Automatic detection of traffic drops that trigger email alerts. Custom reports that combine Search Console data with business metrics from other sources. These capabilities transform SEO from a manual, periodic review process into a continuous, automated monitoring system.

Setting Up Google Cloud Console for API Access

Accessing the Search Console API requires a Google Cloud project with the appropriate API enabled and credentials configured. This sounds more complex than it is. For the Google Sheets automation approach we are using in this lesson, you need a Google Cloud project with the Search Console API enabled and an OAuth consent screen configured. The entire setup takes approximately 15 minutes.

Configuring Google Cloud Console for GSC API access

Free Tier: The Google Search Console API is completely free to use. There are no charges for API calls, data extraction, or Google Cloud project hosting when using only the Search Console API. You do not need to add a billing account to your Google Cloud project for this use case.

Google Sheets and Apps Script: The No-Code Automation Approach

Google Apps Script provides the most accessible way for non-developers to automate Search Console data extraction. Apps Script runs directly within Google Sheets, requires no external servers or hosting, and can be scheduled to run automatically on a daily or weekly basis. The result is a Google Sheet that automatically populates with your latest search performance data, creating a growing historical dataset that updates itself.

The script we are building connects to the Search Console API, extracts search analytics data for your Wix site, and writes it to a designated sheet. You can customise the dimensions, date ranges, and filters to extract exactly the data you need. Once running, the script requires no maintenance unless you need to modify the data it collects.

function fetchSearchConsoleData() {
  var siteUrl = "sc-domain:yourwixsite.com";
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("GSC Data");
  var endDate = new Date();
  endDate.setDate(endDate.getDate() - 3);
  var startDate = new Date();
  startDate.setDate(startDate.getDate() - 30);

  var request = {
    startDate: Utilities.formatDate(startDate, "GMT", "yyyy-MM-dd"),
    endDate: Utilities.formatDate(endDate, "GMT", "yyyy-MM-dd"),
    dimensions: ["query", "page", "date"],
    rowLimit: 25000,
    startRow: 0
  };

  var response = UrlFetchApp.fetch(
    "https://www.googleapis.com/webmasters/v3/sites/" +
    encodeURIComponent(siteUrl) + "/searchAnalytics/query",
    {
      method: "post",
      contentType: "application/json",
      headers: {
        Authorization: "Bearer " + ScriptApp.getOAuthToken()
      },
      payload: JSON.stringify(request)
    }
  );

  var data = JSON.parse(response.getContentText());
  if (!data.rows) return;

  sheet.clear();
  sheet.appendRow(["Query", "Page", "Date", "Clicks", "Impressions", "CTR", "Position"]);

  data.rows.forEach(function(row) {
    sheet.appendRow([
      row.keys[0],
      row.keys[1],
      row.keys[2],
      row.clicks,
      row.impressions,
      row.ctr,
      row.position
    ]);
  });
}

Setting up the Apps Script automation

Data Offset: Search Console data has a processing delay of two to three days. The script sets the end date to three days ago to ensure you are pulling finalised data rather than incomplete preliminary numbers. Do not set the end date to today or yesterday, as the data will be inaccurate.

Custom Keyword Position Tracking

One of the most valuable applications of the GSC API is building a custom keyword position tracker. Unlike third-party rank tracking tools that charge monthly fees and use simulated searches, the Search Console API provides actual average position data based on real impressions served to real users. By pulling this data daily and storing it historically in your Google Sheet, you build a comprehensive position tracking system at zero cost.

Extend the base script to track specific keywords by adding a filter to your API request. Create a sheet listing your target keywords, then modify the script to loop through each keyword and extract its daily position data. Over time, this creates a trend dataset showing exactly how each keyword's ranking changes day by day, with the accuracy and authority of Google's own data rather than estimated positions from third-party tools.

function trackKeywordPositions() {
  var siteUrl = "sc-domain:yourwixsite.com";
  var trackingSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Keyword Tracking");
  var keywordsSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Target Keywords");
  var keywords = keywordsSheet.getRange("A2:A").getValues().flat().filter(String);
  var endDate = new Date();
  endDate.setDate(endDate.getDate() - 3);
  var dateStr = Utilities.formatDate(endDate, "GMT", "yyyy-MM-dd");

  keywords.forEach(function(keyword) {
    var request = {
      startDate: dateStr,
      endDate: dateStr,
      dimensions: ["query"],
      dimensionFilterGroups: [{
        filters: [{
          dimension: "query",
          expression: keyword,
          operator: "equals"
        }]
      }],
      rowLimit: 1
    };

    var response = UrlFetchApp.fetch(
      "https://www.googleapis.com/webmasters/v3/sites/" +
      encodeURIComponent(siteUrl) + "/searchAnalytics/query",
      {
        method: "post",
        contentType: "application/json",
        headers: {
          Authorization: "Bearer " + ScriptApp.getOAuthToken()
        },
        payload: JSON.stringify(request)
      }
    );

    var data = JSON.parse(response.getContentText());
    var position = data.rows ? data.rows[0].position : "N/A";
    var clicks = data.rows ? data.rows[0].clicks : 0;
    var impressions = data.rows ? data.rows[0].impressions : 0;

    trackingSheet.appendRow([dateStr, keyword, position, clicks, impressions]);
  });
}

Automated Weekly SEO Health Checks

Combine the data extraction capabilities with Apps Script's email functionality to build automated SEO health checks that alert you to problems before they become crises. The script can compare this week's data to last week's, identify keywords that dropped more than three positions, flag pages with significant traffic declines, and send you a summary email every Monday morning with the findings.

This proactive monitoring approach is particularly valuable for Wix sites because it catches algorithm-related ranking changes, technical issues affecting indexing, and competitive shifts before they result in significant revenue impact. A weekly automated check that takes the script seconds to run replaces hours of manual Search Console review and ensures nothing falls through the cracks.

function weeklyHealthCheck() {
  var siteUrl = "sc-domain:yourwixsite.com";
  var thisWeekEnd = new Date();
  thisWeekEnd.setDate(thisWeekEnd.getDate() - 3);
  var thisWeekStart = new Date();
  thisWeekStart.setDate(thisWeekStart.getDate() - 10);
  var lastWeekEnd = new Date(thisWeekStart);
  lastWeekEnd.setDate(lastWeekEnd.getDate() - 1);
  var lastWeekStart = new Date(lastWeekEnd);
  lastWeekStart.setDate(lastWeekStart.getDate() - 7);

  var thisWeekData = queryGSC(siteUrl, thisWeekStart, thisWeekEnd);
  var lastWeekData = queryGSC(siteUrl, lastWeekStart, lastWeekEnd);

  var alerts = [];
  var thisWeekMap = {};
  thisWeekData.forEach(function(row) { thisWeekMap[row.keys[0]] = row; });
  lastWeekData.forEach(function(row) {
    var query = row.keys[0];
    if (thisWeekMap[query]) {
      var positionChange = thisWeekMap[query].position - row.position;
      var clickChange = thisWeekMap[query].clicks - row.clicks;
      if (positionChange > 3) {
        alerts.push(query + ": position dropped by " + positionChange.toFixed(1) +
          " (was " + row.position.toFixed(1) + ", now " + thisWeekMap[query].position.toFixed(1) + ")");
      }
      if (clickChange < -10 && row.clicks > 20) {
        alerts.push(query + ": clicks dropped by " + Math.abs(clickChange) +
          " (was " + row.clicks + ", now " + thisWeekMap[query].clicks + ")");
      }
    }
  });

  if (alerts.length > 0) {
    MailApp.sendEmail({
      to: "[email protected]",
      subject: "SEO Alert: " + alerts.length + " issues detected",
      body: "Weekly SEO Health Check\n\n" + alerts.join("\n")
    });
  }
}

function queryGSC(siteUrl, startDate, endDate) {
  var request = {
    startDate: Utilities.formatDate(startDate, "GMT", "yyyy-MM-dd"),
    endDate: Utilities.formatDate(endDate, "GMT", "yyyy-MM-dd"),
    dimensions: ["query"],
    rowLimit: 5000
  };
  var response = UrlFetchApp.fetch(
    "https://www.googleapis.com/webmasters/v3/sites/" +
    encodeURIComponent(siteUrl) + "/searchAnalytics/query",
    {
      method: "post",
      contentType: "application/json",
      headers: { Authorization: "Bearer " + ScriptApp.getOAuthToken() },
      payload: JSON.stringify(request)
    }
  );
  var data = JSON.parse(response.getContentText());
  return data.rows || [];
}

Deploying the weekly health check

API Quotas: The Search Console API has a quota of 1,200 requests per minute per project and 200 requests per minute per site. For most Wix sites, the scripts in this lesson will use only a small fraction of these limits. However, if you run multiple scripts simultaneously or track hundreds of keywords, space out your API calls with Utilities.sleep(1000) between requests to avoid hitting quota limits.

The Search Console API transforms SEO monitoring from a manual, periodic activity into an automated, continuous system. The hour you invest in setting up these scripts will save you hundreds of hours of manual data checking over the life of your Wix site.

Complete How-To Guide: Automating SEO Reporting with the Google Search Console API

This guide walks through setting up Google Cloud credentials, writing your first Apps Script for automated data extraction, and building a keyword position tracking system that runs on autopilot.

How to set up automated SEO reporting using the GSC API and Google Sheets

Free Monitoring: This entire automated reporting system costs nothing. The Google Search Console API is free, Google Sheets is free, and Apps Script triggers are free. You get enterprise-grade position tracking and automated alerting without paying for a single tool subscription.

This lesson on Google Search Console API: automated data extraction and custom reporting is part of Module 22: Advanced Wix SEO Strategies in The Most Comprehensive Complete Wix SEO Course in the World (2026 Edition). Created by Michael Andrews, the UK's No.1 Wix SEO Expert with 14 years of hands-on experience, 750+ completed Wix SEO projects and 425+ verified five-star reviews.