API Reference
Stay organized with collections
Save and categorize content based on your preferences.
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
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 /sites/ siteUrl
/sitemaps/ feedpath
Deletes a sitemap from this site.
GET /sites/ siteUrl
/sitemaps/ feedpath
Retrieves information about a specific sitemap.
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).
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
PUT /sites/ siteUrl
Adds a site to the set of the user's sites in Search Console.
DELETE /sites/ siteUrl
Removes a site from the set of the user's Search Console sites.
GET /sites/ siteUrl
Retrieves information about specific site.
GET /sites
Lists the user's Search Console sites.
For URL Inspection resource details, see the resource representation
page.
Method
HTTP request
Description
URI relative to https://searchconsole.googleapis.com/v1
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"}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-23 UTC."],[[["\u003cp\u003eThe Search Console API provides access to Search Analytics, Sitemaps, Sites, and URL Inspection services.\u003c/p\u003e\n"],["\u003cp\u003eSearch Analytics allows you to query traffic data for your website, filtered by parameters like date and dimensions such as country or device.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage sitemaps through the API by listing, submitting, retrieving information about, or deleting them.\u003c/p\u003e\n"],["\u003cp\u003eManage websites in your Search Console account through the Sites service, allowing you to add, remove, list, and retrieve site information.\u003c/p\u003e\n"],["\u003cp\u003eInspect the Google index status of a specific webpage using the URL Inspection service, requiring the inspection URL, site URL, and language code.\u003c/p\u003e\n"]]],["The Search Console API enables querying site traffic data, managing sitemaps, handling site properties, and inspecting URLs. Key actions include: querying search traffic data with filters and date ranges, listing, retrieving, submitting, and deleting sitemaps. Sites can be added, removed, and listed. Lastly, the API allows inspecting a specific URL's status in the Google index by providing its url, its associated site and a language code.\n"],null,[]]