Page Summary
-
The Search Console API provides access to Search Analytics, Sitemaps, Sites, and URL Inspection services.
-
Search Analytics allows you to query traffic data for your website, filtered by parameters like date and dimensions such as country or device.
-
You can manage sitemaps through the API by listing, submitting, retrieving information about, or deleting them.
-
Manage websites in your Search Console account through the Sites service, allowing you to add, remove, list, and retrieve site information.
-
Inspect the Google index status of a specific webpage using the URL Inspection service, requiring the inspection URL, site URL, and language code.
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.
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.
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.
GET /sites/ siteUrl
/sitemaps
sitemapIndex
is specified in the request).Sites
For Sites Resource details, see the resource representation page.
URL Inspection
For URL Inspection resource details, see the resource representation page.
POST /urlInspection/index:inspect
Information about the provided URL in the Google index.
POST https://searchconsole.googleapis.com/v1/urlInspection/index:inspect
{
"inspectionUrl": "https://www.example.com/mypage",
"siteUrl": "https://www.example.com/",
"languageCode": "en-US"}

