Check whether Google has indexed a page, from your terminal
By Flavio
Updated
Run searchglass inspect on a URL and read Google's answer: indexed, unknown, or a redirect, with the last crawl date and the canonical Google picked.
You publish a page, and a few days later you wonder if Google has it. The Search Console website can tell you, after a few clicks. Searchglass gives you the same answer in the terminal with one command, searchglass inspect.
It reads what Google has already stored about the URL. It doesn’t fetch the live page and it doesn’t ask Google to crawl it. That part is still a button in Search Console, at the end of this tutorial.
Set it up once
Searchglass is a Node.js CLI for macOS and Linux, and it needs Node.js 22 or later. Unzip the download from your Polar receipt and run the installer in that folder:
./install.sh
It links the command at ~/.local/bin/searchglass. If your shell can’t find it, add ~/.local/bin to your PATH.
Then connect your Google account. You need a Google Cloud project with the Search Console API enabled and an OAuth client of type Desktop app. The Searchglass docs walk through those screens. Sign in with the client JSON you downloaded:
searchglass login --client ~/Downloads/google-desktop-client.json
The CLI asks Google for read-only access and saves its login in ~/.config/searchglass/credentials.json. Keep that file out of Git.
Find the property name
Every command takes a --site, and it has to match the Search Console property exactly. searchglass sites lists the ones your account can read. Pass --site to check one:
searchglass sites --site https://flaviocopes.com/
{
"siteUrl": "https://flaviocopes.com/",
"permissionLevel": "siteOwner"
}
flaviocopes.com is a URL-prefix property, so its name has the protocol and a trailing slash. A domain property looks like sc-domain:flaviocopes.com instead. Copy whatever searchglass sites prints.
Inspect a URL
Pass the property and the page you want to check. Here’s the JavaScript guide on this site:
searchglass inspect --site https://flaviocopes.com/ --url https://flaviocopes.com/javascript/
{
"inspectionResult": {
"inspectionResultLink": "https://search.google.com/search-console/inspect?resource_id=https://flaviocopes.com/&id=oGsl9IRUl0ZgbnVk0XR3mA&utm_medium=link&utm_source=api",
"indexStatusResult": {
"verdict": "PASS",
"coverageState": "Submitted and indexed",
"robotsTxtState": "ALLOWED",
"indexingState": "INDEXING_ALLOWED",
"lastCrawlTime": "2026-11-06T12:54:28Z",
"pageFetchState": "SUCCESSFUL",
"googleCanonical": "https://flaviocopes.com/javascript/",
"userCanonical": "https://flaviocopes.com/javascript/",
"referringUrls": [
"https://flaviocopes.com/javascript-string-match/",
"https://flaviocopes.com/javascript-string-normalize/",
"https://flaviocopes.com/javascript-string-tolocalelowercase/",
"https://flaviocopes.com/javascript-string-repeat/",
"https://flaviocopes.com/javascript-string-search/",
"https://flaviocopes.com/javascript-string-localecompare/",
"https://flaviocopes.com/es-modules/",
"https://flaviocopes.com/access/",
"https://flaviocopes.com/create-windows-cloud/",
"https://flaviocopes.com/courses/browser-internals/https/"
],
"crawledAs": "MOBILE"
},
"mobileUsabilityResult": {
"verdict": "VERDICT_UNSPECIFIED"
}
}
}
verdict is PASS and coverageState says “Submitted and indexed”, so the page is in Google’s index. Google crawled it on November 6 with its mobile crawler, and it picked the same canonical URL the page declares.
inspectionResultLink opens the same report in the Search Console website, which is handy when you want to click Request indexing next.

Pull out the fields that matter
The full response gets long. Save it, then use jq to keep the index fields:
searchglass inspect --site https://flaviocopes.com/ --url https://flaviocopes.com/javascript/ > inspection.json
jq '.inspectionResult.indexStatusResult | {verdict, coverageState, indexingState, robotsTxtState, pageFetchState, lastCrawlTime, userCanonical, googleCanonical}' inspection.json
{
"verdict": "PASS",
"coverageState": "Submitted and indexed",
"indexingState": "INDEXING_ALLOWED",
"robotsTxtState": "ALLOWED",
"pageFetchState": "SUCCESSFUL",
"lastCrawlTime": "2026-11-06T12:54:28Z",
"userCanonical": "https://flaviocopes.com/javascript/",
"googleCanonical": "https://flaviocopes.com/javascript/"
}
When Google leaves a field out, jq prints null for it.
indexingState tells you if a noindex blocked the page, robotsTxtState if robots.txt did, and pageFetchState if Google could load it at all. Google documents every value in its inspection result reference.
What the other answers look like
Here’s what came back for a few more URLs on flaviocopes.com:
| URL | verdict | coverageState | What it means |
|---|---|---|---|
/javascript/ | PASS | Submitted and indexed | In the index |
/javascript (no slash) | NEUTRAL | Page with redirect | Google followed the redirect to /javascript/ and indexed that one |
/apps/tutorials/find-pages-that-lost-google-clicks/ | PASS | Submitted and indexed | Published November 5, crawled the same day |
/apps/tutorials/search-console-coding-agent/ | NEUTRAL | URL is unknown to Google | A draft that wasn’t live yet, so Google has never seen it |
An unknown URL comes back with almost nothing else:
{"verdict":"NEUTRAL","coverageState":"URL is unknown to Google","robotsTxtState":"ROBOTS_TXT_STATE_UNSPECIFIED","indexingState":"INDEXING_STATE_UNSPECIFIED","pageFetchState":"PAGE_FETCH_STATE_UNSPECIFIED"}
There’s no lastCrawlTime because there was no crawl. That’s the case where asking for a crawl makes sense.
If googleCanonical and userCanonical differ, Google picked another URL as the main copy. Inspect that one too, and check your redirects, canonical tag and internal links.
Keep in mind the answer describes the last crawl. If you removed a noindex this morning and lastCrawlTime is from last week, the result still describes the old page.
Ask Google for a crawl
Searchglass only reads. It can’t request indexing or submit a sitemap, because it asks Google for read-only access.
To ask for a crawl, open inspectionResultLink in the browser, or go to URL inspection in Search Console and paste the URL, then click Request indexing. Asking Google to index your page walks through that screen. Run searchglass inspect again a few days later to see if coverageState changed.
If it fails
The most common mistake is a property name that’s one character off. Here the trailing slash is missing:
searchglass inspect --site https://flaviocopes.com --url https://flaviocopes.com/javascript/
{"error":{"message":"Search Console HTTP 403: You do not own this site, or the inspected URL is not part of this property. Check property access and that the Search Console API is enabled in the OAuth client’s project."}}
You get the same 403 when the URL belongs to another site. Copy the property from searchglass sites again and make sure the URL is on that site.
If the error says Google connection expired or was revoked, run searchglass login again. OAuth apps left in Testing mode in Google Cloud get refresh tokens that can expire after seven days.
Get Searchglass
Query Google Search Console performance, sitemaps and URL index status from your terminal or coding agent. Includes an installer, agent skill.
See Searchglass → · Read the docs · $19. See the app page for tax details, with full source code.
Want me to talk about your product? You can sponsor this site.