Skip to main content
Skip table of contents

Public Google Search Console API

Index_Inspect

View the indexed or indexable status of the provided URL
Parameter
<inspectionUrl> (required): Inspection Url
<siteUrl> (required): Site Url
<languageCode> (optional): Language Code
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

inspectionDate

timestamp

Inspection date

inspectionUrl

string

Inspection Url

inspectionResultLink

string

Link to Search Console URL inspection

indexStatusResult_sitemap

string

Any sitemaps that this URL was listed in, as known by Google

indexStatusResult_referringUrls

string

URLs that link to the inspected URL, directly and indirectly

indexStatusResult_verdict

string

High-level verdict about whether the URL is indexed

indexStatusResult_coverageState

string

Could Google find and index the page

indexStatusResult_robotsTxtState

string

Whether or not the page is blocked to Google by a robots.txt rule

indexStatusResult_indexingState

string

Whether or not the page blocks indexing through a noindex rule

indexStatusResult_lastCrawlTime

string

Last time this URL was crawled by Google using the primary crawler

indexStatusResult_pageFetchState

string

Whether or not Google could retrieve the page from your server

indexStatusResult_googleCanonical

string

The URL of the page that Google selected as canonical

indexStatusResult_userCanonical

string

The URL that your page or site declares as canonical

indexStatusResult_crawledAs

string

Primary crawler that was used by Google to crawl your site

ampInspectionResult_verdict

string

The status of the most severe error on the page

ampInspectionResult_ampUrl

string

URL of the AMP that was inspected

ampInspectionResult_robotsTxtState

string

Whether or not the page is blocked to Google by a robots.txt rule

ampInspectionResult_indexingState

string

Whether or not the page blocks indexing through a noindex rule

ampInspectionResult_ampIndexStatusVerdict

string

Index status of the AMP URL

ampInspectionResult_lastCrawlTime

string

Last time this AMP version was crawled by Google

ampInspectionResult_pageFetchState

string

Whether or not Google could fetch the AMP

mobileUsabilityResult_verdict

string

High-level mobile-usability inspection result for this URL

richResultsResult_verdict

string

High-level rich results inspection result for this URL

Search Analytics

Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When the date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned.

searchAnalyticsQuery

Searches traffic data by date range and defined keys.

Parameter:

<startDate> (required):  start date of the requested date range, in YYYY-MM-DD format. Must be less than or equal to the end date. This value is included in the range..

<endDate> (required): end date of the requested date range, in YYYY-MM-DD format. Must be greater than or equal to the start date. This value is included in the range.

<site> (optional): the required site.

<json_request_string> (optional): request in JSON.

AttributeTypeDescription

country

string
Filter against the specified country, as specified by 3-letter country code.
device
string

Filter results against the specified device type. Supported values:

  • DESKTOP
  • MOBILE
  • TABLET
page
string
Filter against the specified URI string.
query
string
Filter against the specified query string.
clicks
float
Click count for the row.
impressions
float
Impression count for the row.
ctr
float
Click Through Rate (CTR) for the row. Values range from 0 to 1.0, inclusive.
position
float
Average position in search results.

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_searchAnalyticsQuery_last_2_weeks AS
	SELECT * FROM (
		CALL google_searchconsole_src.searchAnalyticsQuery (
			startDate => cast (timestampadd (sql_tsi_day,- 14,now ()) AS date)
			,endDate => CurDate()
			,site => 'https://datavirtuality.com'
		)
	) a

 

The searchAnalyticsQuery procedure has a maximum number of rows to return of 5000. The original API does not support paged results.

Sitemaps

Contains detailed information about a specific URL submitted as a sitemap.

sitemapsDelete

Deletes a sitemap from this site.

 

Parameter:

<siteUrl> (required):  the site's URL, including protocol. 

<feedpath> (required): the URL of the actual sitemap. 

sitemapsGet

Retrieves information about a specific sitemap.


Parameter:

<siteUrl> (required):  the site's URL, including protocol. 

<feedpath> (required): the URL of the actual sitemap. 

AttributeTypeDescription

path

string
The url of the sitemap.
lastSubmittedtimestampDate & time in which this sitemap was submitted.
isPendingbooleanIf true, the sitemap has not been processed.
isSitemapsIndexbooleanIf true, the sitemap is a collection of sitemaps.
typestringThe type of the sitemap. For example: rssFeed
Acceptable values are:
  • "atomFeed"
  • "notSitemap"
  • "patternSitemap"
  • "rssFeed"
  • "sitemap"
  • "urlList"
lastDownloadedtimestampDate & time in which this sitemap was last downloaded.
warningsintegerNumber of warnings for the sitemap. These are generally non-critical issues with URLs in the sitemaps.
contentsTypestringThe specific type of content in this sitemap. For example: web
Acceptable values are:
  • "androidApp"
  • "image"
  • "iosApp"
  • "mobile"
  • "news"
  • "pattern"
  • "video"
  • "web"
contentsSubmittedintegerThe number of URLs in the sitemap (of the content type).
contentsIndexedintegerThe number of URLs from the sitemap that were indexed (of the content type).

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_sitemapsGet As
	SELECT * FROM (
		CALL google_searchconsole_src.sitemapsGet(
			siteUrl => 'https://sites.google.com/a/datavirtuality.de/testsite', 
			feedpath => 'https://sites.google.com/a/datavirtuality.de/testsite/sitemap.xml'
		)
	)t

sitemapsList

Lists the sitemaps-entries submitted for this site, or included in the sitemap index file.

 

Parameter:

<siteUrl> (required):  the site's URL, including protocol.

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_sitemapsList AS
	SELECT * FROM (
		CALL google_searchconsole_src.sitemapsList(
			siteUrl => 'https://datavirtuality.com'
		)
	)t

sitemapsSubmit

Submits a sitemap.

Parameter:

<siteUrl> (required):  the site's URL, including protocol.

<feedpath> (required): the URL of the actual sitemap. 

Sites

sitesAdd

Adds a site to the set of the user's sites in the Search Console.

Parameter:

<siteUrl> (required): The URL of the site to add.

sitesDelete

Removes a site from the set of the user's Search Console sites.

Parameter: 

<siteUrl> (required): The URL of the property as defined in the Search Console.

sitesGet

Retrieves information about a specific site.

Parameter: 

<siteUrl> (required): The URI of the property as defined in the Search Console.

AttributeTypeDescription

siteUrl

string
The URL of the site.
permissionLevel
string
The user's permission level for the site. 
Acceptable values are:
  • "siteFullUser"
  • "siteOwner"
  • "siteRestrictedUser"
  • "siteUnverifiedUser"

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_sitesGet AS
	SELECT * FROM (
		CALL google_searchconsole_src.sitesGet(
			siteUrl => 'https://datavirtuality.com'
		)
	)t

sitesList

Lists the user's Search Console sites.

Parameter: 

<siteUrl> (required): The URI of the property as defined in Search Console.

Example

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_sitesList AS
	SELECT * FROM (
		CALL google_searchconsole_src.sitesList()
	) t

 

URL Crawl Errors Counts

urlCrawlErrorsCountsQuery

Retrieves a time series of the number of URL crawl errors per error category and platform.

Parameter: 

<siteUrl> (required): the site's URL, including protocol.

<category> (optional): the crawl error category.  If not specified, returns results for all categories. Acceptable values:   "authPermissions", "manyToOneRedirect", "notFollowed", "notFound", "other", "roboted", "serverError", "soft404"

<platform> (optional): the user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms. Acceptable values: "mobile", "smartphoneOnly", "web"

AttributeTypeDescription

count

long
The error count at the given timestamp.
category
string
The crawl error type. 
Acceptable values are:
  • "authPermissions"
  • "manyToOneRedirect"
  • "notFollowed"
  • "notFound"
  • "other"
  • "roboted"
  • "serverError"
  • "soft404"
platformstringThe user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms. 
Acceptable values are:
  • "mobile"
  • "smartphoneOnly"
  • "web"
timestamptimestampThe date and time when the crawl attempt took place.

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_urlCrawlErrorsCountsQuery AS
	SELECT * FROM (
		CALL google_searchconsole_src.urlCrawlErrorsCountsQuery(
			siteUrl => 'https://datavirtuality.com', 
			platform => 'mobile'
		)
	) t

URL Crawl Errors Samples

urlCrawlErrorsSamplesGet

Retrieves details about crawl errors for a site's sample URL.

Parameter: 

<siteUrl> (required): the site's URL, including protocol.

<url> (required): the relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). 

<category> (required): the crawl error category. Example: authPermissions. Acceptable values: "authPermissions", "manyToOneRedirect", "notFollowed", "notFound", "other", "roboted", "serverError", "soft404"

<platform> (required): the user agent type (platform) that made the request. Example: web. Acceptable values: "mobile", "smartphoneOnly", "web",  

AttributeTypeDescription

pageUrl

string
The URL of an error, relative to the site.
last_crawledtimestampThe time when the URL was last crawled.
first_detectedtimestampThe time the error was first detected.
responseCodeintegerThe HTTP response code, if any.

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_urlCrawlErrorsSamplesGet AS
	SELECT * FROM (
		CALL google_searchconsole_src.urlCrawlErrorsSamplesGet(
			siteUrl => 'https://sites.google.com/a/datavirtuality.de/testsite', 
			url => 'undefined', 
			category => 'notFound', 
			platform => 'web'
		)
	) t

urlCrawlErrorsSamplesList

Lists a site's sample URLs for the specified crawl error category and platform.

Parameter: 

<siteUrl> (required): the site's URL, including protocol.

<category> (required): the crawl error category. Example: authPermissions. Acceptable values are: "authPermissions", "manyToOneRedirect", "notFollowed", "notFound", "other", "roboted", "serverError", "soft404"

<platform> (required): the user agent type (platform) that made the request. Example: webAcceptable values: "mobile", "smartphoneOnly", "web". 

AttributeTypeDescription

pageUrl

string
The URL of an error, relative to the site.
last_crawledtimestampThe time when the URL was last crawled.
first_detectedtimestampThe time the error was first detected.
responseCodeintegerThe HTTP response code, if any.

Example

SQL
CREATE VIEW Google_SearchConsole_examples.example_urlCrawlErrorsSamplesList AS
	SELECT * FROM (
		CALL google_searchconsole_src.urlCrawlErrorsSamplesList(
			siteUrl => 'https://sites.google.com/a/datavirtuality.de/testsite', 
			category => 'notFound', 
			platform => 'web'
		)
	) t

urlCrawlErrorsSamplesMarkAsFixed

Marks the provided site's sample URL as fixed, and removes it from the samples list.

Parameter: 

<siteUrl> (required): the site's URL, including protocol.

<url> (required): The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). 

<category> (required): the crawl error category. Example: authPermissions. Acceptable values: "authPermissions", "manyToOneRedirect", "notFollowed", "notFound", "other", "roboted", "serverError", "soft404"

<platform> (required): the user agent type (platform) that made the request. Example: webAcceptable values: "mobile", "smartphoneOnly", "web".

Standard Error Messages

Please see the official documentation.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.