Agent Wranglers

SEO-68Recommended

Export search data for every page each month

Export clicks, impressions, click-through rate and average position for every page and query each month, through the Search Console API. Keep every export, so later changes have a baseline.

How to do it

Clicks count visits from the results, and impressions count how often a link to the site was shown. Click-through rate is clicks divided by impressions, and position is the topmost place your page held, averaged. Grouped by page, the numbers count each page apart. Grouped by query, they count the whole site. Some rare queries are left out to protect privacy, so query rows add up to less than the total. A download from the report keeps only 1,000 rows. The API returns up to 25,000 rows per request, with startRow for the rest. Bing Webmaster Tools offers the same numbers for Bing. Compare the exports as Track every change before and after says.

Examples

JavaScript example

const site = encodeURIComponent('sc-domain:example.com');
const response = await fetch(`https://www.googleapis.com/webmasters/v3/sites/${site}/searchAnalytics/query`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ startDate: '2026-09-01', endDate: '2026-09-30', dimensions: ['page', 'query'], rowLimit: 25000, startRow: 0 }),
});
const { rows = [] } = await response.json();

Python example

import requests
from urllib.parse import quote

site = quote("sc-domain:example.com", safe="")
response = requests.post(
    f"https://www.googleapis.com/webmasters/v3/sites/{site}/searchAnalytics/query",
    headers={"Authorization": f"Bearer {token}"},
    json={"startDate": "2026-09-01", "endDate": "2026-09-30", "dimensions": ["page", "query"], "rowLimit": 25000, "startRow": 0},
    timeout=30,
)
rows = response.json().get("rows", [])

How to check

A scheduled job stores one export per month with the page and query dimensions. The newest export is less than 35 days old and holds as many rows as the API returned.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/seo/measuring-results/performance-per-page">Agent Wranglers SEO playbook</a>. In code you write, add a comment next to it with the same link.