Getting information about a sitemap file

Description

Gets detailed information about the sitemap file, including file type, date, method used for uploading the file to Yandex.Webmaster, date the file was processed by the service, number of URLs contained in the file, and number and type of errors found.

Request format

Send a GET request to the operation address for the site's sitemaps resource:

GET https://api.webmaster.yandex.net/v3/user/{user-id}/hosts/{host-id}/sitemaps/?sitemap_id={sitemap_id}

Path parameters

Name Required Type Default value Description
user-id Yes int64 The user ID.
host-id Yes host id Site ID.

Query arguments

Name Required Type Default value Description
sitemap_id Yes sitemap id ID of the sitemap file.

Response format

If successful, the server returns 200 OK and information about the requested sitemap.

Samples

{
  "sitemap_id": "c7-fe:80-c0",
  "sitemap_url": "some url",
  "last_access_date": "2016-01-01T00:00:00,000+0300",
  "errors_count": 1,
  "urls_count": 1,
  "children_count": 1,
  "sources": [
    "ROBOTS_TXT", ...
  ],
  "sitemap_type": "SITEMAP"
}
Name Required Type Description
sitemap_id Yes string ID of the sitemap file.
sitemap_url Yes string URL of the sitemap file.
last_access_date Yes yyyy-MM-ddTHH:mm:ss,sssZ The date when the file was last visited.
errors_count Yes int32 The number of errors in the file.
urls_count Yes int64 The number of URLs in the file.
children_count Yes int32 The number of child sitemaps.
Source Yes ApiSitemapSource The sources that led the robot to this file.
sitemap_type Yes ApiSitemapType The type of sitemap file.

Sitemap source (ApiSitemapSource)

Source Description
ROBOTS_TXT The sitemap is specified in the robots.txt file on the site.
WEBMASTER The user added the sitemap in Yandex.Webmaster.
INDEX_SITEMAP The sitemap was found in another (indexed) sitemap file.

Type of sitemap file (ApiSitemapType)

Type Description
SITEMAP A normal sitemap file containing the URLs of site pages.
INDEX_SITEMAP A sitemap index containing the URLs of other sitemaps.

Errors

403 Forbidden

The user ID for the token doesn't match the one specified in the request. In the examples below, {user_id} is the correct uid for the owner of the OAuth token.

{
  "error_code": "INVALID_USER_ID",
  "available_user_id": 1,
  "error_message": "Invalid user id. {user_id} should be used."
}
Parameter Description
error_code Error code.
available_user_id ID of the user who allowed access.
error_message Error message.

404 Not Found

  • SITEMAP_NOT_FOUND error

    {
      "error_code": "SITEMAP_NOT_FOUND",
      "host_id": "http:ya.ru:80",
      "sitemap_id": "c7-fe:80-c0",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code The site hasn't been indexed yet.
    host_id Site ID.
    sitemap_id ID of the sitemap file.
    error_message Error message.
  • HOST_NOT_LOADED error

    {
      "error_code": "HOST_NOT_LOADED",
      "host_id": "http:ya.ru:80",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code The site data hasn't been loaded to Yandex.Webmaster yet.
    host_id Site ID.
    error_message Error message.
  • HOST_NOT_VERIFIED error

    {
      "error_code": "HOST_NOT_VERIFIED",
      "host_id": "http:ya.ru:80",
      "error_message": "explicit error message"
    }
    Parameter Description
    error_code The site hasn't been added to the list of sites, or the user hasn't verified site management rights.
    host_id Site ID.
    error_message Error message.