Google Search Console
v1.4.0Search Console analytics, hourly data, URL inspection and sitemaps, with guards for API quirks.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_sites List Search Console properties
List every Search Console property this account can access, with its exact site_url and permission level. Call this first: every other tool needs a site_url.
get_site Get a Search Console property
Get one property's exact site_url, type and this account's permission level.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
add_site Add a Search Console property
Add a property to this account. It starts unverified: ownership must be verified in the Search Console web interface before any data is available.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | New property: 'sc-domain:example.com' or a URL prefix such as 'https://www.example.com/'. |
delete_site Delete a Search Console property
Remove a property from this account. This removes access for this account only; it does not delete the site or other users' access. Confirm with the user first.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property's exact site_url, as listed by list_sites. |
query_search_analytics Query search analytics
Clicks, impressions, CTR and average position from the Performance report, grouped by dimensions and filtered. Rows are sorted by clicks. Invalid combinations are rejected with an explanation before Google is called. For Discover, Images, video, Google News or the News tab, the matching query_*_analytics tool offers only what that surface supports.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' is right almost always. byProperty cannot be used with page grouping or filters, nor with Discover or Google News. |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these, in order. Omit for ['query']; pass [] for property totals. searchAppearance must be the only dimension (see list_search_appearances). Discover and Google News have no query dimens… | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
search_type | string | web, image, video, news (the News tab), discover or googleNews. |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_discover_analytics Query Discover performance
Google Discover performance: clicks, impressions and CTR by page, country or date. Discover reports no queries, no average position and no device breakdown, and has data only for sites that appear in Discover feeds.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' aggregates by page. byNewsShowcasePanel counts News Showcase panels instead: it needs the filter searchAppearance equals NEWS_SHOWCASE and cannot group or filter by page, so dimensions default… |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these. Omit for ['page'] (['date'] with byNewsShowcasePanel); [] for totals. | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_image_analytics Query Google Images performance
Performance in Google Images and the Images tab of Search: clicks, impressions, CTR and average position within image results, by query, page, country, device or date.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' is right almost always. byProperty cannot be used with page grouping or filters. |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these. Omit for ['query']; [] for totals. searchAppearance must be the only dimension. | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_video_analytics Query video search performance
Performance in the Videos tab of Google Search: clicks, impressions, CTR and average position, by query, page, country, device or date. Video results shown on the main web results are counted under web search, not here.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' is right almost always. byProperty cannot be used with page grouping or filters. |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these. Omit for ['query']; [] for totals. searchAppearance must be the only dimension. | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_google_news_analytics Query Google News performance
Google News performance (news.google.com and the Google News app): clicks, impressions and CTR by page, country, device or date. Google News reports no queries and no average position. For the News tab in Google Search, use query_news_tab_analytics.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' aggregates by page. byNewsShowcasePanel counts News Showcase panels instead: it needs the filter searchAppearance equals NEWS_SHOWCASE and cannot group or filter by page, so dimensions default… |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these. Omit for ['page'] (['date'] with byNewsShowcasePanel); [] for totals. | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_news_tab_analytics Query News tab performance
Performance in the News tab of Google Search: clicks, impressions, CTR and average position, by query, page, country, device or date. For news.google.com and the Google News app, use query_google_news_analytics.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
aggregation_type | string | 'auto' is right almost always. byProperty cannot be used with page grouping or filters. |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Group rows by these. Omit for ['query']; [] for totals. searchAppearance must be the only dimension. | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
query_hourly_analytics Query hourly search analytics
Search performance broken down by hour (Pacific Time) for the last ~10 days. Use it to spot same-day spikes or compare today with the same day last week. The most recent hours are incomplete; first_incomplete_hour says where that starts.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
dimensions | Extra grouping besides the hour. Omit for hourly totals. | |
end_date | Last day, YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Filters, combined with AND. | |
row_limit | integer | Rows to return (1-25,000). |
search_type | string | |
start_date | First day, YYYY-MM-DD in Pacific Time, within the last 10 days. Defaults to 2 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
list_search_appearances List search appearances
Step one: list the search appearances (rich results and other result features, such as VIDEO or REVIEW_SNIPPET) the property had, with clicks and impressions. Then call query_search_appearance with one of the names to break it down.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
search_type | string | |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. |
query_search_appearance Query one search appearance
Step two: performance of one search appearance, broken down by query, page, country, device or date. Get the appearance name from list_search_appearances.
| Parameter | Type | Description |
|---|---|---|
appearance * | string | Exact appearance name from list_search_appearances, such as VIDEO or REVIEW_SNIPPET. |
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
data_state | string | 'all' includes fresh data that may still change and matches the Search Console UI; 'final' is finalized data only (lags 2-3 days). |
dimensions | Break the appearance down by these. Omit for ['query'] (['page'] for Discover and Google News). | |
end_date | Last day (inclusive), YYYY-MM-DD in Pacific Time. Defaults to today. | |
filters | Extra filters, combined with AND with the appearance. | |
row_limit | integer | Rows to return (1-25,000). |
search_type | string | |
start_date | First day, YYYY-MM-DD in Pacific Time. Defaults to 28 days ago. | |
start_row | integer | Zero-based row offset, for paging. |
compare_periods Compare two periods
Compare search performance between two periods of equal length: totals plus a per-key breakdown with absolute and percent changes. Position change is negative when ranking improved.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
current_end | Last day of the period to analyze. Defaults to 3 days ago, the last day that is usually final. | |
current_start | First day of the period to analyze, YYYY-MM-DD (Pacific Time). | |
data_state | string | Defaults to 'final': fresh, still-changing data in the current period would read as a decline against a complete baseline. |
dimensions | Compare per value of these. Omit for ['query']; [] for totals only. | |
fetch_limit | integer | Top rows fetched per period before joining. |
filters | Filters, combined with AND. | |
previous_end | Last day of the baseline; same length as current. | |
previous_start | First day of the baseline. Defaults to the period just before. | |
row_limit | integer | Rows to return. |
search_type | string | |
sort_by | string | clicks_change (default) and impressions_change rank the biggest gains and losses first; ties fall back to the other metric's change, then current impressions. clicks and impressions rank by the curren… |
explain_change Explain a change in traffic
Answer "why did traffic go up or down?" between two periods of equal length. Splits the change by page, query, country, device and search appearance and says which slices account for most of it; separates clicks lost to fewer impressions from clicks lost to a lower CTR; and lists Google updates that ran in or near the periods. Defaults compare the last 28 days of final data with the 28 before.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
breakdowns | Dimensions to split the change by. Omit for every one the search type has: page, query, country, device and searchAppearance. | |
current_end | Last day of the period to analyze. Defaults to 3 days ago, the last day that is usually final. | |
current_start | First day of the period to analyze, YYYY-MM-DD (Pacific Time). | |
data_state | string | Defaults to 'final': fresh, still-changing data in the current period would read as a decline against a complete baseline. |
fetch_limit | integer | Top rows fetched per period and breakdown. |
filters | Explain the change within this slice only; combined with AND. | |
metric | string | The metric whose change to explain. |
previous_end | Last day of the baseline; same length as current. | |
previous_start | First day of the baseline. Defaults to the period just before. | |
search_type | string | |
top | integer | Movers to list per breakdown and direction. |
inspect_url Inspect a URL
Google's index status for one URL: whether it is indexed and why not, last crawl, canonical chosen by Google versus declared, robots.txt and fetch state, sitemaps and rich results. This is Google's indexed view, not a live test of the page.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
url * | string | Full URL of the page, inside the property. |
language_code | string | BCP-47 language for issue messages, e.g. 'en-US' or 'de-DE'. |
batch_inspect_urls Inspect many URLs
Inspect up to 50 URLs concurrently and summarize their index verdicts. Failures are reported per URL; if the daily quota runs out, the remaining URLs are skipped and listed so you can retry them later.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
urls * | array | 1-50 page URLs. |
language_code | string | BCP-47 language for issue messages, e.g. 'en-US' or 'de-DE'. |
audit_indexing Audit indexing
Full indexing audit of a property, rebuilt from its sitemaps because Google's API does not expose the Page indexing report's URL lists. Each call inspects the next URLs (new ones first, then any checked more than 14 days ago) and reports every URL inspected so far: grouped by Google's index status with likely fixes, plus canonical conflicts, indexed pages with no search impressions in 90 days, and pages shown in search but missing from the sitemaps. Progress is saved locally, so call again to continue, today or on later days; Google allows 2,000…
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
examples | integer | Example URLs shown per issue. |
fetch_pages | boolean | Also fetch inspected pages directly (only URLs inside the property), as many as inspect or 50 if it is 0, to compare their status code, redirects, noindex and canonical tag now with what Google last s… |
inspect | integer | URLs to inspect in this call. Each takes a few seconds and they run 10 at a time, so 50 is about 30 seconds. 0 only reports. |
issue | List every URL with this issue key (from issues[].key), 100 at a time. Nothing new is inspected. | |
restart | boolean | Forget this property's saved audit and start over. |
sitemap_url | Audit this sitemap (or sitemap index) instead of every sitemap submitted for the property. | |
start | integer | Offset into the issue's URLs. |
list_sitemaps List sitemaps
List submitted sitemaps with their status: last submitted and downloaded, errors, warnings, whether processing is pending, and URL counts by content type.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
sitemap_index | Only list the sitemaps inside this sitemap index URL. |
get_sitemap Get a sitemap
Status of one submitted sitemap.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property, as listed by list_sites: 'sc-domain:example.com' for a domain property or 'https://www.example.com/' for a URL-prefix property. A bare domain such as 'example.com', or any URL on the sit… |
sitemap_url * | string | Full URL of the sitemap, e.g. 'https://www.example.com/sitemap.xml'. |
submit_sitemap Submit a sitemap
Submit (or resubmit) a sitemap so Google fetches it. Safe to repeat.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property's exact site_url, as listed by list_sites. |
sitemap_url * | string | Full URL of the sitemap, e.g. 'https://www.example.com/sitemap.xml'. |
delete_sitemap Delete a sitemap
Remove a sitemap from Search Console. Google may still know the URLs in it, and the file itself is not touched. Confirm with the user first.
| Parameter | Type | Description |
|---|---|---|
site_url * | string | The property's exact site_url, as listed by list_sites. |
sitemap_url * | string | Full URL of the sitemap, e.g. 'https://www.example.com/sitemap.xml'. |