Skip to content

Google Search Console

Search clicks, impressions, CTR and rankings for the sites you manage in Google Search Console

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/google-search-console/index.md to help me query Google Search Console with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Find the search queries bringing visitors to your site

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT site_url, query, clicks, impressions, round(position, 1) AS position
FROM gsc.main.search_analytics('', dimensions => ['query'], max_rows => 1000)
ORDER BY clicks DESC
LIMIT 25

Quick start

Choose where to run Google Search Console, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'gsc' AS gsc (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-google-search-console'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

google_search_console credentials

Google Search Console credentials (scope webmasters.readonly). Provide ONE of: service_account_json (a service-account key, the account added to the Search Console property as a user); client_id + client_secret + refresh_token (an OAuth user grant); or access_token (short-lived). quota_project_id optionally bills API quota to a specific Google Cloud project.

Get these credentials β†’
secret.sql
CREATE SECRET google_search_console (
    TYPE google_search_console,
    service_account_json '<GOOGLE_SEARCH_CONSOLE_SERVICE_ACCOUNT_JSON>',  -- secret
    client_id            '<client_id>',
    client_secret        '<GOOGLE_SEARCH_CONSOLE_CLIENT_SECRET>',  -- secret
    refresh_token        '<REFRESH_TOKEN>',  -- secret
    access_token         '<ACCESS_TOKEN>',  -- secret
    quota_project_id     '<quota_project_id>'
);
Credential fields and requirements β†’

4. Run a query

query.sql
SELECT site_url, query, clicks, impressions, round(position, 1) AS position
FROM gsc.main.search_analytics('', dimensions => ['query'], max_rows => 1000)
ORDER BY clicks DESC
LIMIT 25
More example queries β†’
Technical details
Verified connector release
v0.2.1
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'gsc' AS gsc (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-google-search-console'
);

Overview

Read-only Google Search Console: search performance, sitemaps and URL index status

ATTACH options

credentials
Where credentials come from: 'auto' (default) uses the google_search_console secret and otherwise Application Default Credentials where the worker permits it; 'secret' requires the secret and never falls back; 'oauth' signs in locally through the browser to Query Farm's app and carries refreshable credentials in the client's opaque attach data.VARCHAR
page_size
Rows fetched per search_analytics() API request, up to 25000 (the default).BIGINT
api_url
Base URL of the Search Console API, for a proxy or a test double. Overriding it disables the Application Default Credentials fallback.VARCHAR

Catalog

Everything gsc exposes once attached β€” read straight from the worker's released build.

gsc 1 schema
main 1 table Β· 4 functions

Search Console API (read-only, webmasters.readonly scope)

Schema examples (9)
Examples (9)

Every property this credential can read

SELECT site_url, property_type, permission_level
FROM gsc.main.sites
ORDER BY site_url;

Daily clicks and impressions for each property over the last 28 days

SELECT site_url, date, clicks, impressions
FROM gsc.main.search_analytics('', dimensions => ['date'])
ORDER BY site_url, date;

The queries that bring the most clicks

SELECT site_url, query, clicks, impressions, round(position, 1) AS position
FROM gsc.main.search_analytics('', dimensions => ['query'], max_rows => 1000)
ORDER BY clicks DESC
LIMIT 25;

Clicks by country and device

SELECT site_url, country, device, clicks
FROM gsc.main.search_analytics('', dimensions => ['country', 'device'], max_rows => 1000)
ORDER BY clicks DESC
LIMIT 25;
5 more examples

Sitemaps with errors or warnings, across every property

SELECT site_url, path, errors, warnings
FROM gsc.main.sitemaps('')
WHERE errors > 0 OR warnings > 0
ORDER BY errors DESC;

Index status of the most-clicked page

SELECT p.page, i.verdict, i.coverage_state, i.last_crawl_time
FROM (SELECT site_url, page FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 100) ORDER BY clicks DESC LIMIT 1) p,
     LATERAL gsc.main.url_inspection(p.site_url, p.page) i;

Each readable property's kind with its clicks and impressions over the last 28 days, 0 where Google returned no rows

SELECT s.site_url, s.property_type, coalesce(t.clicks, 0) AS clicks,
  coalesce(t.impressions, 0) AS impressions
FROM gsc.main.sites s
LEFT JOIN gsc.main.search_analytics('') t ON t.site_url = s.site_url
WHERE s.permission_level <> 'siteUnverifiedUser'
ORDER BY clicks DESC, s.site_url;

For each property with sitemaps, web URLs listed in them versus pages that earned impressions in the last 28 days (counting up to 25,000 pages)

WITH listed AS (SELECT site_url, sum(c.submitted) AS submitted_urls FROM (SELECT site_url, unnest(contents) AS c FROM gsc.main.sitemaps('')) WHERE c.type = 'web' GROUP BY site_url), searched AS (SELECT site_url, count(*) AS pages_with_impressions FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 25000) GROUP BY site_url) SELECT l.site_url, l.submitted_urls, coalesce(s.pages_with_impressions, 0) AS pages_with_impressions
FROM listed l
LEFT JOIN searched s USING (site_url)
ORDER BY l.site_url;

Which of the 10 most-clicked pages Google has not seen in any sitemap, with their coverage state

SELECT p.site_url, p.page, p.clicks, i.coverage_state
FROM (SELECT site_url, page, clicks FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 100) ORDER BY clicks DESC LIMIT 10) p,
     LATERAL gsc.main.url_inspection(p.site_url, p.page, cache_ttl => 3600) i
WHERE len(i.sitemaps) = 0
ORDER BY p.clicks DESC, p.site_url, p.page;
Tables
sites 3 examples3 cols

Every Search Console property the credential can see β€” the entry point

Columns
site_urlnot null VARCHAR
The property, exactly as Search Console lists it: 'sc-domain:example.com' for a domain property, or the full URL such as 'https://www.example.com/' for a URL-prefix property. The first argument every other function takes.
permission_level VARCHAR
What the credential may do with the property: siteOwner, siteFullUser, siteRestrictedUser, or siteUnverifiedUser (listed, but its data cannot be read).
property_type VARCHAR
'domain' for a domain property, which covers every protocol and subdomain, or 'url_prefix' for one that covers only URLs beginning with site_url.
ConstraintsPRIMARY KEY (site_url)
Examples (3)

Every property this credential can read

SELECT site_url, property_type, permission_level
FROM gsc.main.sites
ORDER BY site_url;

Properties by kind and access level

SELECT property_type, permission_level, count(*) AS properties
FROM gsc.main.sites
GROUP BY property_type, permission_level
ORDER BY properties DESC;

Each readable property's kind with its clicks and impressions over the last 28 days, 0 where Google returned no rows

SELECT s.site_url, s.property_type, coalesce(t.clicks, 0) AS clicks,
  coalesce(t.impressions, 0) AS impressions
FROM gsc.main.sites s
LEFT JOIN gsc.main.search_analytics('') t ON t.site_url = s.site_url
WHERE s.permission_level <> 'siteUnverifiedUser'
ORDER BY clicks DESC, s.site_url;
Link
Table functions
all_sites () 1 example

Every Search Console property the credential can see (the scan backing sites)

No arguments
Returns columns
site_url VARCHAR
The property, exactly as Search Console lists it: 'sc-domain:example.com' for a domain property, or the full URL such as 'https://www.example.com/' for a URL-prefix property. The first argument every other function takes.
permission_level VARCHAR
What the credential may do with the property: siteOwner, siteFullUser, siteRestrictedUser, or siteUnverifiedUser (listed, but its data cannot be read).
property_type VARCHAR
'domain' for a domain property, which covers every protocol and subdomain, or 'url_prefix' for one that covers only URLs beginning with site_url.
Example

Every property and what the credential may do with it

SELECT site_url, property_type, permission_level
FROM gsc.main.all_sites()
ORDER BY site_url;
Link
search_analytics (site_url VARCHAR, aggregation_type := VARCHAR, cache_ttl := BIGINT, data_state := VARCHAR, dimensions := VARCHAR[], end_date := VARCHAR, filters := VARCHAR, max_rows := BIGINT, search_type := VARCHAR, start_date := VARCHAR) 5 examples

Google Search performance: clicks, impressions, CTR and position by dimension

Positional arguments
site_url VARCHAR
Property, e.g. 'sc-domain:example.com' or 'https://www.example.com/', exactly as the sites table lists it. Empty string = every property the credential can read.
Named arguments
aggregation_type := VARCHAR
How results are counted: by_property counts a search once however many of the site's pages appeared, by_page counts each page; auto (default) lets Google choose from the dimensions. Β· default "auto"
cache_ttl := BIGINT
Seconds DuckDB may reuse this result (0 = always re-query). Β· default 0
data_state := VARCHAR
final (default) returns only finalized days, which lag by two or three; all includes fresh days that may still change; hourly_all is required for the hour dimension. Β· default "final"
dimensions := VARCHAR[]
Dimensions to group by, each becoming a column, in this order; empty for one total row. The function documentation lists the seven dimensions. Β· default []
end_date := VARCHAR
Last day of the range, inclusive β€” an ISO date, today, yesterday, or NdaysAgo (such as 28daysAgo), in Pacific Time. Β· default "today"
filters := VARCHAR
JSON array of filter objects, each with a dimension, an operator and an expression, ANDed together and applied by Google before aggregation; may name dimensions that are not in the output. The function documentation shows the syntax. Β· default ""
max_rows := BIGINT
Stop after this many rows for each property (0 = every row available). Β· default 0
search_type := VARCHAR
Which Google surface to report on: web (default), image, video, news, discover or google_news. Β· default "web"
start_date := VARCHAR
First day of the range, inclusive β€” an ISO date, today, yesterday, or NdaysAgo (such as 28daysAgo), in Pacific Time. Β· default "28daysAgo"
Returns columns
site_url VARCHAR
Property the row belongs to.
date DATE
Day of the searches, in Pacific Time.
hour TIMESTAMP WITH TIME ZONE
Start of the hour (needs `data_state => 'hourly_all'`).
query VARCHAR
The search query, lowercased; rare queries are withheld.
page VARCHAR
URL of the page shown in results.
country VARCHAR
Lowercase ISO 3166-1 alpha-3 code, e.g. `usa`.
device VARCHAR
`DESKTOP`, `MOBILE` or `TABLET`.
search_appearance VARCHAR
Search result feature the page was shown with.
clicks BIGINT
Clicks through to the property.
impressions BIGINT
Times the property appeared in results.
ctr DOUBLE
clicks / impressions, 0 to 1. Do not average.
position DOUBLE
Average topmost position, 1 = top; NULL for Discover and Google News.
Returns columns Β· depends on the arguments
Always first
site_url VARCHAR
Property the row belongs to.
One column per requested dimension
date DATE
Day of the searches, in Pacific Time.
hour TIMESTAMP WITH TIME ZONE
Start of the hour (needs `data_state => 'hourly_all'`).
query VARCHAR
The search query, lowercased; rare queries are withheld.
page VARCHAR
URL of the page shown in results.
country VARCHAR
Lowercase ISO 3166-1 alpha-3 code, e.g. `usa`.
device VARCHAR
`DESKTOP`, `MOBILE` or `TABLET`.
search_appearance VARCHAR
Search result feature the page was shown with.
Always last
clicks BIGINT
Clicks through to the property.
impressions BIGINT
Times the property appeared in results.
ctr DOUBLE
clicks / impressions, 0 to 1. Do not average.
position DOUBLE
Average topmost position, 1 = top; NULL for Discover and Google News.
Examples (5)

Daily clicks and impressions for each property over the last 28 days

SELECT site_url, date, clicks, impressions
FROM gsc.main.search_analytics('', dimensions => ['date'])
ORDER BY site_url, date;

The queries that bring the most clicks

SELECT site_url, query, clicks, impressions, round(position, 1) AS position
FROM gsc.main.search_analytics('', dimensions => ['query'], max_rows => 1000)
ORDER BY clicks DESC
LIMIT 25;

Pages with many impressions but a low click-through rate

SELECT site_url, page, impressions, clicks,
  round(ctr * 100, 2) AS ctr_percent
FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 1000)
WHERE impressions > 100
ORDER BY ctr
LIMIT 25;
2 more examples

Clicks by device, for searches from one country only

SELECT site_url, device, clicks, impressions
FROM gsc.main.search_analytics('', dimensions => ['device'], filters => '[{"dimension": "country", "operator": "equals", "expression": "usa"}]')
ORDER BY site_url, clicks DESC;

Each property's total for the last 7 days, as one row

SELECT site_url, clicks, impressions, ctr, position
FROM gsc.main.search_analytics('', start_date => '7daysAgo')
ORDER BY clicks DESC;
Link
sitemaps (site_url VARCHAR, sitemap_index := VARCHAR) 4 examples

Sitemaps submitted for a Search Console property, with their status and contents

Positional arguments
site_url VARCHAR
Property, e.g. 'sc-domain:example.com' or 'https://www.example.com/', exactly as the sites table lists it. Empty string = every property the credential can read.
Named arguments
sitemap_index := VARCHAR
URL of a sitemap index; lists the sitemaps inside it instead of those submitted directly. Needs a site_url. Β· default ""
Returns columns
site_url VARCHAR
Property the sitemap was submitted for.
path VARCHAR
URL of the sitemap.
type VARCHAR
Format Google detected: sitemap, rssFeed, atomFeed, urlList, patternSitemap or notSitemap.
is_sitemaps_index BOOLEAN
True for a sitemap index, which lists other sitemaps rather than pages.
is_pending BOOLEAN
True while Google has not yet processed the sitemap since it was submitted.
last_submitted TIMESTAMP WITH TIME ZONE
When the sitemap was last submitted to Search Console.
last_downloaded TIMESTAMP WITH TIME ZONE
When Google last fetched the sitemap.
warnings BIGINT
Number of warnings Google raised for the sitemap.
errors BIGINT
Number of errors Google found in the sitemap.
contents STRUCT of 3 fields[]
What the sitemap lists, one entry per content type (web, image, video, news, …) with the number of URLs submitted. `indexed` is deprecated by Google and usually NULL. Apply unnest() for one row per content type.
STRUCT[] 3 fields
  • typeVARCHAR
  • submittedBIGINT
  • indexedBIGINT
Examples (4)

Sitemaps with errors or warnings, across every property

SELECT site_url, path, errors, warnings, last_downloaded
FROM gsc.main.sitemaps('')
WHERE errors > 0 OR warnings > 0
ORDER BY errors DESC, warnings DESC;

URLs submitted per content type, for each sitemap

SELECT site_url, path, c.type AS content_type, c.submitted
FROM (SELECT site_url, path, unnest(contents) AS c FROM gsc.main.sitemaps(''))
ORDER BY site_url, path, content_type;

Properties with no sitemap submitted at all

SELECT s.site_url
FROM gsc.main.sites s
WHERE s.permission_level <> 'siteUnverifiedUser' AND s.site_url NOT IN (SELECT site_url FROM gsc.main.sitemaps(''))
ORDER BY s.site_url;
1 more example

For each property with sitemaps, web URLs listed in them versus pages that earned impressions in the last 28 days (counting up to 25,000 pages)

WITH listed AS (SELECT site_url, sum(c.submitted) AS submitted_urls FROM (SELECT site_url, unnest(contents) AS c FROM gsc.main.sitemaps('')) WHERE c.type = 'web' GROUP BY site_url), searched AS (SELECT site_url, count(*) AS pages_with_impressions FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 25000) GROUP BY site_url) SELECT l.site_url, l.submitted_urls, coalesce(s.pages_with_impressions, 0) AS pages_with_impressions
FROM listed l
LEFT JOIN searched s USING (site_url)
ORDER BY l.site_url;
Link
url_inspection (site_url VARCHAR, url VARCHAR, cache_ttl := BIGINT, language_code := VARCHAR) 3 examples

Google's index status for a URL: verdict, coverage, crawl, canonical, rich results

Positional arguments
site_url VARCHAR
Property the URL belongs to, e.g. 'sc-domain:example.com', exactly as the sites table lists it.
url VARCHAR
Full URL of the page to inspect, e.g. 'https://www.example.com/pricing'.
Named arguments
cache_ttl := BIGINT
Seconds to cache each URL's result (0 = off); saves quota when URLs repeat. Β· default 0
language_code := VARCHAR
BCP-47 language for the translated text in the result, such as coverage_state. Β· default "en-US"
Returns columns
site_url VARCHAR
Property the URL was inspected under.
inspection_url VARCHAR
The URL that was inspected.
verdict VARCHAR
Google's overall index verdict: PASS (indexed and eligible to appear), PARTIAL, FAIL (not indexed), or NEUTRAL (excluded, e.g. a duplicate or a redirect).
coverage_state VARCHAR
The reason behind the verdict, as the Search Console interface words it, e.g. 'Submitted and indexed' or 'Crawled - currently not indexed'.
robots_txt_state VARCHAR
Whether robots.txt lets Google crawl the URL: ALLOWED or DISALLOWED.
indexing_state VARCHAR
Whether the page permits indexing: INDEXING_ALLOWED, BLOCKED_BY_META_TAG, BLOCKED_BY_HTTP_HEADER or BLOCKED_BY_ROBOTS_TXT.
page_fetch_state VARCHAR
Outcome of Google's last fetch: SUCCESSFUL, SOFT_404, NOT_FOUND, ACCESS_DENIED, ACCESS_FORBIDDEN, BLOCKED_ROBOTS_TXT, BLOCKED_4XX, SERVER_ERROR, REDIRECT_ERROR, INTERNAL_CRAWL_ERROR or INVALID_URL.
last_crawl_time TIMESTAMP WITH TIME ZONE
When Google last crawled the URL; NULL if it never has.
crawled_as VARCHAR
Which crawler fetched it: DESKTOP or MOBILE.
google_canonical VARCHAR
The URL Google chose as canonical β€” the one that is actually indexed and shown.
user_canonical VARCHAR
The canonical URL the page declares for itself; differs from google_canonical when Google overrode the declaration.
sitemaps VARCHAR[]
Submitted sitemaps that list this URL.
referring_urls VARCHAR[]
Pages through which Google found this URL (a sample, not the full link graph).
amp_verdict VARCHAR
Verdict for the page's AMP version; NULL when it has none.
amp_url VARCHAR
URL of the AMP version that was inspected.
amp_issues STRUCT("issue_message" VARCHAR, "severity" VARCHAR)[]
Problems found in the AMP version, each with its message and severity (WARNING or ERROR).
rich_results_verdict VARCHAR
Verdict for the structured data on the page; NULL when none was detected.
rich_result_types VARCHAR[]
Rich result types detected on the page, e.g. 'Breadcrumbs', 'FAQ', 'Product snippets'.
rich_result_issues STRUCT of 4 fields[]
Problems in the structured data, one entry per issue with the rich result type and item it belongs to and its severity (WARNING or ERROR).
STRUCT[] 4 fields
  • rich_result_typeVARCHAR
  • item_nameVARCHAR
  • severityVARCHAR
  • issue_messageVARCHAR
inspection_result_link VARCHAR
Link to this inspection in the Search Console interface.
Examples (3)

Is the most-clicked page indexed, and when was it last crawled?

SELECT p.page, i.verdict, i.coverage_state, i.last_crawl_time
FROM (SELECT site_url, page FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 100) ORDER BY clicks DESC LIMIT 1) p,
     LATERAL gsc.main.url_inspection(p.site_url, p.page) i;

Which of the 10 most-clicked pages Google has not seen in any sitemap, with their coverage state

SELECT p.site_url, p.page, p.clicks, i.coverage_state
FROM (SELECT site_url, page, clicks FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 100) ORDER BY clicks DESC LIMIT 10) p,
     LATERAL gsc.main.url_inspection(p.site_url, p.page, cache_ttl => 3600) i
WHERE len(i.sitemaps) = 0
ORDER BY p.clicks DESC, p.site_url, p.page;

Top pages where Google chose a different canonical than the page declares

SELECT p.page, i.user_canonical, i.google_canonical
FROM (SELECT site_url, page FROM gsc.main.search_analytics('', dimensions => ['page'], max_rows => 100) ORDER BY clicks DESC LIMIT 10) p,
     LATERAL gsc.main.url_inspection(p.site_url, p.page, cache_ttl => 3600) i
WHERE i.google_canonical IS DISTINCT FROM i.user_canonical;
Link

Credentials

The secret type gsc declares, as reported by the worker itself.

google_search_console

How to get these credentials

Google Search Console credentials (scope webmasters.readonly). Provide ONE of: service_account_json (a service-account key, the account added to the Search Console property as a user); client_id + client_secret + refresh_token (an OAuth user grant); or access_token (short-lived). quota_project_id optionally bills API quota to a specific Google Cloud project.

secret.sql
CREATE SECRET google_search_console (
    TYPE google_search_console,
    service_account_json '<GOOGLE_SEARCH_CONSOLE_SERVICE_ACCOUNT_JSON>',  -- secret
    client_id            '<client_id>',
    client_secret        '<GOOGLE_SEARCH_CONSOLE_CLIENT_SECRET>',  -- secret
    refresh_token        '<REFRESH_TOKEN>',  -- secret
    access_token         '<ACCESS_TOKEN>',  -- secret
    quota_project_id     '<quota_project_id>'
);
Key Type Required Description
service_account_json secret VARCHAR β€” Contents of a service-account JSON key file.
client_id VARCHAR β€” OAuth client id of a user grant.
client_secret secret VARCHAR β€” OAuth client secret of a user grant.
refresh_token secret VARCHAR β€” OAuth refresh token granting webmasters.readonly.
access_token secret VARCHAR β€” Short-lived OAuth access token (about an hour).
quota_project_id VARCHAR β€” Google Cloud project to bill API quota to (optional).

The worker doesn't mark which keys are required.

Needed by all_sitessitemapssearch_analyticsurl_inspection

Create the secret in the same session, after attaching gsc β€” the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

sites_and_scan_function_agree β€” The sites table and the function behind it return the same rows.

SELECT (SELECT count(*) FROM gsc.main.sites) = (SELECT count(*) FROM gsc.main.all_sites());

Uses sitesall_sites

property_types_are_derived β€” Every property is classified as a domain or a URL-prefix property.

SELECT bool_and(property_type IN ('domain', 'url_prefix')) IS NOT FALSE
FROM gsc.main.sites;

Uses sites

search_analytics_columns_are_typed β€” A date column is a DATE, counts are BIGINT and ratios DOUBLE.

SELECT column_name, column_type
FROM (DESCRIBE SELECT * FROM gsc.main.search_analytics('', dimensions => ['date']))
ORDER BY column_name;

Uses search_analytics

rows_belong_to_readable_properties β€” An every-property query only returns rows for properties in the sites table.

SELECT count(*)
FROM gsc.main.search_analytics('', dimensions => ['date'], start_date => '7daysAgo')
WHERE site_url NOT IN (SELECT site_url FROM gsc.main.sites);

Uses search_analyticssites

Sitemaps with errors or warnings, across every property

SELECT site_url, path, errors, warnings
FROM gsc.main.sitemaps('')
WHERE errors > 0 OR warnings > 0
ORDER BY errors DESC

Uses sitemaps

Every property and what the credential may do with it

SELECT site_url, property_type, permission_level
FROM gsc.main.all_sites()
ORDER BY site_url

Uses all_sites

2 more examples

max_rows_caps_each_property β€” max_rows bounds the rows returned for each property.

SELECT coalesce(max(n), 0) <= 3
FROM (SELECT count(*) AS n FROM gsc.main.search_analytics('', dimensions => ['query'], max_rows => 3) GROUP BY site_url);

Uses search_analytics

a_date_predicate_is_honoured β€” Rows outside a WHERE on date never come back.

SELECT count(*)
FROM gsc.main.search_analytics('', dimensions => ['date'])
WHERE date > current_date + 1;

Uses search_analytics

15 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Which Google Search Console properties can I query, and what is my access to each?
  • How many clicks and impressions did each of my Search Console properties get from Google Search on each of the last 7 days?
  • How many clicks in total did each of my properties get from Google Search in the last 28 days?
  • What was the average position in Google Search of each of my properties over the last 28 days?
  • Which search queries brought the most clicks to my properties in the last 28 days?
  • Which pages across my properties got the most impressions in the last 28 days?

Google Search Console is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.