Getting information about a site

Description

Gets information about the current state of site indexing.

Request format

Send a GET request to the address of the user site resource:

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

Path parameters

NameRequiredTypeDefault valueDescription
user-idYesint64The user ID.
host-idYeshost idSite ID.

Response format

If successful, the server returns 200 OK and information about the site (if the site is verified).

Example

{
  "host_id": "https:ya.ru:443",
  "verified": true,
  "ascii_host_url": "https://ya.ru/",
  "unicode_host_url": "https://ya.ru/",
  "main_mirror": {
    "host_id": "http:xn--d1acpjx3f.xn--p1ai:80",
    "ascii_host_url": "http://xn--d1acpjx3f.xn--p1ai/",
    "unicode_host_url": "http://яндекс.рф/",
    "verified": false
  },
  "host_data_status": "NOT_INDEXED",
  "host_display_name": "Ya.ru"
}
NameRequiredTypeDescription
host_idYeshost idSite ID.
ascii_host_urlYesstringASCII URL of the site.
unicode_host_urlYesstringUTF-8 URL of the site.
verifiedYesbooleanWhether the site is verified.
main_mirrorNoThe site's main mirror, if there is one.
host_data_statusNoApiHostDataStatusInformation about the site (shown if the site is verified).
host_display_nameNostringThe site name to display.

The status of site indexing (ApiHostDataStatus)

SourceDescription
NOT_INDEXEDThe site hasn't been indexed yet.
NOT_LOADEDThe site data hasn't been loaded to Yandex.Webmaster yet.
OKThe site has been indexed and data is available in Yandex.Webmaster.

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."
}
ParameterDescription
error_codeError code.
available_user_idID of the user who allowed access.
error_messageError message.

404 Not Found

The site isn't in the list of the user's sites, or rights to the site haven't been verified.

{
  "error_code": "HOST_NOT_FOUND",
  "host_id": "http:ya.ru:80",
  "error_message": "explicit error message"
}
ParameterDescription
error_codeError code.
host_idThe ID of the requested site.
error_messageError message.