Search Console's own coverage report is not available through the API, but two things are: the pages that earn impressions (which are therefore indexed) and the URL Inspection API for anything specific. Put together with the sitemap, that is enough to find the pages that should be indexed and are not.
Steps
-
Pull the pages Google is showing.
google_search_console.querywithdimensions: ["page"], 90 days ending 3 days ago,rowLimit: 1000. Every page here has been indexed at some point in the window. -
Pull the sitemap picture.
google_search_console.list_sitemapsfor submitted and indexed counts per sitemap; the gap is the first coverage number. Then fetch the sitemap XML with your own browsing to get the full URL list (calllist_sitemapsagain withsitemapIndexset if there is an index). -
Find the two mismatches.
- Sitemap URLs with zero impressions in 90 days: possibly not indexed, or indexed with no demand. Rank them by how much they matter: product, pricing, docs and top-level guides first, tag pages and archives last. Ask if the ranking is not obvious.
- Pages with impressions that are not in the sitemap: indexed, but the sitemap is incomplete. A list to add.
-
Inspect a prioritised sample.
google_search_console.inspect_urlwith up to ten URLs per call: the five highest-priority zero-impression URLs, plus five of the top-traffic pages to catch canonical drift on the pages that matter most. Run a second call if the user wants more, and say the API is quota-limited so this is a sample. -
Classify the inspected rows. Indexed (verdict PASS, coverage submitted and indexed), not indexed by choice (noindex, canonical elsewhere), not indexed by problem (crawled or discovered but not indexed, blocked, fetch error), and canonical mismatch (Google canonical differs from user canonical). Count each.
-
Report. The sitemap submitted-vs-indexed table; the count and top twenty of zero-impression sitemap URLs; the count and top twenty of indexed pages missing from the sitemap; the inspected sample with its classification; and a short list of URLs to hand to
page-not-indexed-debugone at a time.
Gotchas
- Zero impressions is not proof of not indexed. A page can be indexed and never shown. Inspection is the only confirmation, which is why the sample exists.
- The sitemap report's indexed count is Google's own and lags. Treat it as directional.
- Search Console page rows are capped and filtered. A large site will not return every indexed page in 1000 rows. Raise the limit or scope with a
pagefilter per section. - Inspect the winners too. Canonical drift on a top page (Google picking a different URL) costs more than a hundred unindexed tag pages.
- Search Console lags 2 to 3 days. End the window 3 days back.