Today Google is launching the new Google Search Console URL Inspection API, which gives programmatic access to URL-level data for properties that are managed in Search Console. The Search Console APIs are a way to access data outside of Search Console, through external applications and products. With the new URL Inspection API, developers will be able to debug and optimize their pages.
The new API can be found in the API developer documentation. The request parameters include the URL you’d like to inspect and the URL of the property as defined in Search Console.
The response from the Google Search Console API includes analysis results containing information from Search Console, including index status, AMP, rich results, and mobile usability.
Once you make the API call, you will get a response with all relevant results, or an error message if the request fails. If a specific analysis result is missing from the response, it means the analysis was not available for the URL inspected.
Here's an example of the response you’ll get from the API:
"coverageState": "Indexed, not submitted in sitemap"
According to the Google Search Console, the "robotsTxtState" for this website is set to "ALLOWED", which means that search engine crawlers are allowed to access and index the site's content. The "indexingState" is also set to "INDEXING_ALLOWED", indicating that the site's content is being indexed by Google and may appear in search results. The "lastCrawlTime" shows when Google last crawled the site (in this case, January 31st, 2022). The "pageFetchState" indicates that the page was successfully fetched by Google, and the "googleCanonical" and "userCanonical" URLs both point to the same page on the site. The site has also been linked to from other websites, including https://developers.google.com/search/updates and https://developers.google.com/search/help/crawling-index-faq. Finally, the "crawledAs" field indicates that Google has crawled this page as a mobile page.
The website's mobile usability and rich results have also been checked by Google, with both receiving a passing grade.
The new URL Inspection API provides more detailed data about specific URLs, and how Google sees them. This can be useful for SEOs and publishers who want to monitor important pages, or debug issues with structured data or canonicals.
The API has a quota which is enforced per Search Console website property. More detailed information about usage limits can be found in the developer documentation.
Google has announced an update to the Search Console API, which will now allow developers to query up to 2,000 times per day. This change will open up new opportunities for developers and SEOs to build around the Search Console APIs.
If you have any questions or feedback, reach out to Google on Twitter or post a question in the Search Central community.