Updates to Search Console’s API

December 9, 2020

A few months ago, Google announced an API infrastructure upgrade to improve the performance of the Search Console API as demand grows. Today, Google is announcing some more updates to the API, including the addition of fresh data and news filter in the Search Console API, and domain property support in the Sitemaps API.

The Performance report already supports fresh data that is less than a day old. This data can now be accessed through the API by passing the request parameter dataState with value set to all. The data you get for this value will also include fresh data that is not yet final. If you wish to get only final data, you can either pass this parameter with value set to final or not pass it at all and you will get only final data by default.

For more information on these changes, check out Google's blog post here.

A few months ago, Google added a News tab on the Search filter to the Performance report. This information is now also available in the API, and you can access it by setting the value of the searchType parameter in the request to news.

The Sitemaps API now supports domain properties, as other Search Console APIs already do. You can query, add, and delete your sitemaps on domain properties, for example:

GET https://www.googleapis.com/webmasters/v3/sites/sc-domain:example.com/sitemaps

We'll drop the support in the Webmasters discovery document. If you're querying the Search Console API using an external API library, or querying the Webmasters API discovery document directly, you will need to update your API calls to include the following changes.

The Google Search Console API has recently been updated, and developers using the API will need to make a few changes to their code in order to stay compatible.

For Java users, all imports related to the Webmasters service should be changed to use the searchconsole.v1 package instead of the webmasters package. Additionally, the service name Webmasters should be changed to SearchConsole. You can find more detailed instructions in the Java quickstart guide.

For Python users, when building the Webmasters service object, you will need to use the build() function from the googleapiclient.discovery module instead of the webmasters() function from the googleapiclient.discovery_cache module. You can find more detailed instructions in the Python quickstart guide.

Google has announced changes to the discovery document querying for the Webmasters API. The URL has changed from https://www.googleapis.com/discovery/v1/apis/webmasters/v3/rest to https://searchconsole.googleapis.com/$discovery/rest, and the name and version fields have both changed accordingly.

If you have any questions, you can ask in the Search Central community or on Twitter.

New and improved crawl stats are now available for your site.
To help website owners better understand how Googlebot crawls their sites, Google is launching a brand new version of the Crawl stats report in Search Console. The new Crawl Stats report brings the fo...
Read More
Update on the Structured Data Testing Tool
On Tuesday, December 15, 2020, Google announced that it is refocusing the Structured Data Testing Tool and migrating it to a new domain serving the schema.org community by April 2021. The main purpose...
Read More