API Reference

The Search Console API offers the following services:

  • Search Analytics - Query traffic data for your site.
  • Sitemaps - List all your sitemaps, request information about a specific sitemap, and submit a sitemap to Google.
  • Sites - List/add/remove properties from your Search Console account.
  • URL Inspection - Inspect the status of a page in the Google index (equivalent to URL Inspection in Search Console).

Search Analytics

For Search Analytics Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/webmasters/v3, unless otherwise noted
query POST  /sites/siteUrl/searchAnalytics/query

Query your search traffic data with filters and parameters that you define. The method returns zero or more rows grouped by the row keys (dimensions) that you define. You must define a date range of one or more days.

When date is one of the dimensions, any days without data are omitted from the result list. To learn which days have data, issue a query without filters grouped by date, for the date range of interest.

Results are sorted by click count descending. If two rows have the same click count, they are sorted in an arbitrary way.

See the python sample for calling this method.

JSON POST Example:
POST https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.example.com%2F/searchAnalytics/query
{
  "startDate": "2015-04-01",
  "endDate": "2015-05-01",
  "dimensions": ["country","device"]
}

Sitemaps

For Sitemaps Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/webmasters/v3, unless otherwise noted
delete DELETE  /sites/siteUrl/sitemaps/feedpath Deletes a sitemap from this site.
get GET  /sites/siteUrl/sitemaps/feedpath Retrieves information about a specific sitemap.
list GET  /sites/siteUrl/sitemaps Lists the sitemaps-entries submitted for this site, or included in the sitemap index file (if sitemapIndex is specified in the request).
submit PUT  /sites/siteUrl/sitemaps/feedpath Submits a sitemap for a site.

Sites

For Sites Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/webmasters/v3, unless otherwise noted
add PUT  /sites/siteUrl Adds a site to the set of the user's sites in Search Console.
delete DELETE  /sites/siteUrl Removes a site from the set of the user's Search Console sites.
get GET  /sites/siteUrl Retrieves information about specific site.
list GET  /sites Lists the user's Search Console sites.

URL Inspection

For URL Inspection resource details, see the resource representation page.

Method HTTP request Description
URI relative to https://searchconsole.googleapis.com/v1
index.inspect POST /urlInspection/index:inspect

Information about the provided URL in the Google index.

JSON POST Example:
POST https://searchconsole.googleapis.com/v1/urlInspection/index:inspect
{
  "inspectionUrl": "https://www.example.com/mypage",
  "siteUrl": "https://www.example.com/",
  "languageCode": "en-US"}