The catalogue/Google Search Console
Google Search Console
app.google.search-console
SEO performance, URL inspection and sitemaps from Google Search Console
What it does
The app, in its own words.
Google Search Console: query search performance (clicks, impressions, CTR, position by query, page, country, device, date), compare periods, inspect URL index status, and manage sitemaps and properties through the Search Console API.
Tools
12 tools the agent can call.
Every one is declared with typed parameters and returns structured results, so the host can render them instead of narrating them.
- add-siteAdd a property to the connected account's Search Console. A new property starts unverified (permissionLevel siteUnverifiedUser, no data) until ownership is verified outside this app (DNS record, HTML file or tag, in the Search Console UI); if this account already verified it, access comes back at once. Adding an existing property is harmless. Returns { success, siteUrl, permissionLevel }.
- compare-periodsCompare Search Console performance between two periods to find what gained or lost traffic. Groups by one dimension (query by default, or page, country, device, searchAppearance) and compares the current range (default the last 28 days of final data) with the period right before it (compareTo previous_period) or 52 weeks earlier (previous_year, same weekdays). Returns { current, previous } totals and items: [{ key, clicks, previousClicks, clicksChange, impressions, previousImpressions, impressionsChange, ctr, previousCtr, position, previousPosition, positionChange }], sorted by the largest click change (or only losses / gains). A negative positionChange means the ranking improved. Only the top 5,000 keys of each period are compared.
- delete-siteRemove a property from the connected account's Search Console. The account loses access to its data and settings through this app until the property is added and verified again; other users of the property keep theirs, and the website is not touched. Use list-sites first to copy the exact siteUrl. Returns { success, siteUrl }.
- delete-sitemapRemove a sitemap from a property's Sitemaps report. Its report history in Search Console is lost; the sitemap file on the website is not touched, and Google may still find it through robots.txt. Needs owner or full user permission. Returns { success, siteUrl, sitemapUrl }.
- get-sitemapGet the processing status of one submitted sitemap. Returns { path, type, isSitemapsIndex, isPending, lastSubmitted, lastDownloaded, errors, warnings, contents: [{ type, submitted }] }. isPending true means Google has not processed it yet. [NOT_FOUND] means it was never submitted for this property: use submit-sitemap.
- get-top-pagesTop pages of a property by clicks from Google Search for a date range (default the last 28 days of final data). Returns { items: [{ page, clicks, impressions, ctr, position }] } sorted by clicks. Optionally only for one query (query: exact text), pages whose URL contains a text, one country or device. Use inspect-url on a page to check its index status.
- get-top-queriesTop search queries of a property by clicks for a date range (default the last 28 days of final data). Returns { items: [{ query, clicks, impressions, ctr, position }] } sorted by clicks. Optionally only for one page (page: exact URL), queries containing a text, one country or device. For other groupings or paging use query-search-analytics.
- inspect-urlInspect one URL with Search Console's URL Inspection: Google's indexed version of the page, not a live test. Returns { verdict (PASS, NEUTRAL, FAIL), coverageState (e.g. "Submitted and indexed", "Crawled - currently not indexed"), indexingState, robotsTxtState, pageFetchState, lastCrawlTime, crawledAs, googleCanonical, userCanonical, sitemaps, referringUrls, richResults, amp, inspectionResultLink }. The URL must belong to siteUrl. Quota: about 2,000 inspections per property per day and 600 per minute, so inspect a handful of URLs, not a whole site.
- list-sitemapsList the sitemaps submitted for a property (or the children of one sitemap index). Returns { sitemaps: [{ path, type, isSitemapsIndex, isPending, lastSubmitted, lastDownloaded, errors, warnings, contents: [{ type, submitted }] }], total, hasMore, nextOffset }. errors > 0 means Google could not process the sitemap; use get-sitemap for one sitemap and submit-sitemap to (re)submit.
- list-sitesList the Search Console properties the connected Google account can see. Returns { sites: [{ siteUrl, permissionLevel }], total, hasMore, nextOffset }. siteUrl is either "sc-domain:example.com" (Domain property) or "https://www.example.com/" (URL-prefix property); pass it unchanged as siteUrl to every other tool. permissionLevel is siteOwner, siteFullUser, siteRestrictedUser or siteUnverifiedUser (no data access). Start here when you do not know the exact siteUrl.
- query-search-analyticsQuery the Search Console Performance report (Search Analytics) of one property: clicks, impressions, ctr (0-1) and average position, grouped by any of query, page, country, device, searchAppearance, date, hour, with filters. Returns { columns, rows, rowCount, startRow, hasMore, nextStartRow, limitApplied } where each row is an array in the order of columns (the dimensions, then clicks, impressions, ctr, position). Rows come sorted by clicks descending (by date when grouped by date). Page through with startRow: nextStartRow. Data is in Pacific Time, lags about 2-3 days for final data and goes back about 16 months; Google returns top rows only, not every long-tail row. For quick answers use get-top-queries or get-top-pages; to find what changed use compare-periods.
- submit-sitemapSubmit (or resubmit) a sitemap for a property so Google crawls it. Needs owner or full user permission on the property. Google processes it later: check with get-sitemap (isPending, errors). Resubmitting the same URL is harmless. Returns { success, siteUrl, sitemapUrl }.
Auth and permissions
What it asks for.
Declared in the manifest, in advance. The app cannot reach anything it did not ask for here.
Scopes
System secrets
Installation secrets
Reading further
The manifest and the source for Google Search Console live in the repository, alongside the other apps.