---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.ru/dev/webmaster/doc/en/reference/host-diagnostics-get.md
  - https://yandex.ru/dev/webmaster/doc/ru/reference/host-diagnostics-get.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/webmaster/doc/en/llms.txt

# Site diagnostics

Returns information about errors on the site.

## Request format

```
GET https://api.webmaster.yandex.net/v4/user/{[user-id](*user-id)}/hosts/{[host-id](*host-id)}/diagnostics
```

#|
||
`user-id`
|
<!-- source: en/_includes/popups.md -->
Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.ru/dev/webmaster/doc/en/reference/user.md) method.
<!-- endsource: en/_includes/popups.md -->
||
||
`host-id`
|
<!-- source: en/_includes/popups.md -->
Type: `host id (string)`. The site ID. To get it, use the [GET /v4/user/{user-id}/hosts](https://yandex.ru/dev/webmaster/doc/en/reference/hosts.md) method.
<!-- endsource: en/_includes/popups.md -->
||
|#

## Response format

### Examples
 
> 
> {% list tabs %}
> 
> - JSON
> 
>   
>   ```javascript
>   {
>     "problems": {
>       "NO_SITEMAPS": {
>         "severity": "FATAL",
>         "state": "PRESENT",
>         "last_state_update": "2016-01-01T00:00:00,000+0300"
>       }
>     }
>   }
>   ```
>   
> 
> - XML
> 
>   
>   ```xml
>   <Data>  
>     <problems>
>       <[NO_SITEMAPS](*NO_SITEMAPS)>      
>         <[severity](*severity)>FATAL</severity>      
>         <[state](*state)>PRESENT</state>      
>         <[last_state_update](*last_state_update)>2016-01-01T00:00:00,000+0300</last_state_update>
>       </NO_SITEMAPS>    
>     </problems>
>   </Data>
>   ```
> 
> {% endlist %}
> 
> **Name** | **Required** | **Type** | **Description**
> ----- | ----- | ----- | -----
> `NO_SITEMAPS` | Yes | [ApiSiteProblemTypeEnum](#api-sites-problem-type) | Problem.
> `severity` | Yes | `string` ([SiteProblemSeverityEnum](#site-problem-severity)) | Issue type
> `state` | Yes | `string` ([ApiSiteProblemState](#api-site-problem-state)) | State of the issue.
> `last_state_update` | Yes | `datetime` | The date the issue status was last changed.

### Type of site issue (ApiSiteProblemTypeEnum) {#api-sites-problem-type}

#|
|| **Indicator** | **Description** ||
|| **FATAL** | > ||
|| DISALLOWED_IN_ROBOTS | The site is prohibited for indexing in the `robots.txt` file. ||
|| DNS_ERROR | Failed to connect to the server due to a DNS error. ||
|| MAIN_PAGE_ERROR | The site's home page returns an error. ||
|| THREATS | Security threats or issues were detected. ||
|| **CRITICAL** | > ||
|| SLOW_AVG_RESPONSE_TIME | Slow server response. For more information, see this [Help section](https://yandex.com/support/webmaster/diagnosis/critical.html#diagnostics-critical__request). ||
|| SSL_CERTIFICATE_ERROR | Invalid SSL certificate settings. For more information, see this [Help section](https://yandex.com/support/webmaster/diagnosis/critical.html#diagnostics-critical__ssl). ||
|| **POSSIBLE_PROBLEM** | > ||
|| BAD_ADVERTISEMENT | Ad formats do not comply with IAB Russia recommendations. ||
|| DOCUMENTS_MISSING_DESCRIPTION | Many pages do not have the Description meta tag. ||
|| DOCUMENTS_MISSING_TITLE | The `title` element is missing on many pages. ||
|| ERROR_IN_ROBOTS_TXT | Errors in the `robots.txt` file. ||
|| ERRORS_IN_SITEMAPS | Errors found in the `Sitemap` file. ||
|| MAIN_MIRROR_IS_NOT_HTTPS | The site's main mirror doesn't use the HTTPS protocol We recommend using the HTTPS protocol. For more information and instructions on switching protocols, see the [Help](https://yandex.com/support/webmaster/yandex-indexing/https-migration.html). ||
|| MAIN_PAGE_REDIRECTS | The main page redirects to another site. ||
|| NO_METRIKA_COUNTER_CRAWL_ENABLED | Site crawling using Yandex.Metrica tags isn't enabled. For more information about site indexing using the Yandex.Metrica tag, see the [Help](https://yandex.com/support/webmaster/indexing-options/link-metrica.html). ||
|| NO_ROBOTS_TXT | The `robots.txt` file wasn't found. ||
|| NO_SITEMAPS | The `Sitemap` files used by the robot are missing. ||
|| NO_SITEMAP_MODIFICATIONS | The `Sitemap` files haven't been updated for a long time. ||
|| NON_WORKING_VIDEO | The robot failed to index videos on the site. ||
|| SOFT_404 | The display of non-existent files and pages is configured incorrectly. ||
|| TOO_MANY_DOMAINS_ON_SEARCH | The site subdomains are found in the search results. ||
|| TOO_MANY_PAGE_DUPLICATES | Too many duplicate pages. ||
|| **RECOMMENDATION** | > ||
|| FAVICON_PROBLEM | The `favicon` file was not found. The robot failed to load an image file to display in the browser tab and next to the site name in the search results. For more information about this error and how to fix it, see the [help section](https://yandex.com/support/webmaster/search-results/favicon.html). ||
|| INCOMPLETE_SPRAV_COMPANY_PROFILE | Yandex.Directory contains incomplete information about the organization. ||
|| NO_CHATS | [Chats on Search](https://tech.yandex.ru/dialogs/chats/doc/index-docpage/) are missing. ||
|| NO_METRIKA_COUNTER | Yandex.Metrica tag error ||
|| NO_REGIONS | The site region isn't set. ||
|| NOT_IN_SPRAV | The site isn't registered in Yandex.Directory. ||
|| NOT_MOBILE_FRIENDLY | The site isn't optimized for mobile devices. ||
|#

### Issue categories on the site (SiteProblemSeverityEnum) {#site-problem-severity}

#|
||
**Indicator** | **Description** | **Note**
||
||
`FATAL`
|
Fatal errors. Checks the server connection, site availability for indexing, security and compliance with [Yandex guidelines](https://yandex.ru/company/rules/optimization/).
|
This may lead to excluding individual pages or the entire site from search results.

We recommend monitoring these errors and fixing them as soon as possible.
||
||
`CRITICAL`
|
Critical issues. Checks the presence and validity of the SSL certificate, the number of broken internal links, and the server response time.
|
^
||
||
`POSSIBLE_PROBLEM`
|
Possible issues. Checks the [Sitemap](https://yandex.com/support/webmaster/controlling-robot/sitemap.html) and [robots.txt](https://yandex.com/support/webmaster/controlling-robot/robots-txt.html) file validity, settings for displaying non-existent files, the number of duplicate pages, the presence of redirects, annoying ads, and so on.
|
May affect the quality and speed of site indexing.
||
||
`RECOMMENDATION`
|
Recommendations. Usually includes suggestions for improving the site's ranking in search results.
|
Use them to improve the site's ranking in search results.
||
|#


### State of the issue (ApiSiteProblemState) {#api-site-problem-state}

#|
|| **Indicator** | **Description** ||
|| `PRESENT` | Present on the site. ||
|| `ABSENT` | Missing. ||
|| `UNDEFINED` | Not enough data to determine if there are issues. ||
|#


To find out more about the site status, go to **site diagnostics** in Yandex.Webmaster. You can also [configure notifications](https://webmaster.yandex.com/settings/) to receive the diagnostic messages by email.

## Response codes

To view the response structure in detail, click the reason.

#|
||
**Code** | **Reason** | **Description**
||
||
200 | OK | 
||
||
403
|
[INVALID_USER_ID](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#invalid-user-id)
|
The ID of the user who issued the token differs from the one specified in the request. In the examples below, `{user_id}` shows the correct `uid` of the OAuth token owner.

{% list tabs %}

- JSON

  ```json
  {
      "error_code": "INVALID_USER_ID",   
      "available_user_id": 1,   
      "error_message": "Invalid user id. {user_id} should be used."
  }
  ```
- XML

  ```xml
  <Data>     
      <[error_code](*error_code)>INVALID_USER_ID</error_code>     
      <[available_user_id](*available_user_id)>1</available_user_id>     
      <[error_message](*error_message)>Invalid user id. {user_id} should be used.</error_message> 
  </Data>
  ```
  
{% endlist %}
||
||
404
|
[HOST_NOT_VERIFIED](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md#host-not-verif)
|
Site management rights are not verified.

{% list tabs %}

- JSON

  ```json 
  {   
      "error_code": "HOST_NOT_VERIFIED",   
      "host_id": "http:ya.ru:80",   
      "error_message": "some string"
  }
  ```
- XML

  ```xml 
  <Data>   
      <[error_code](*error_code)>HOST_NOT_VERIFIED</error_code>     
      <[host_id](*host_id)>http:ya.ru:80</host_id>   
      <[error_message](*error_message)>some string</error_message> 
  </Data>
  ```
{% endlist %}
||
|#

### Related Information

- [Error codes and statuses](https://yandex.ru/dev/webmaster/doc/en/reference/errors.md)




[*user-id]: Type: `int64`. User ID. Required when calling all Yandex.Webmaster API resources. To get it, use the [GET /v4/user](https://yandex.ru/dev/webmaster/doc/en/reference/user.md) method.

[*host-id]: Type: `host id (string)`. The site ID. To get it, use the [GET /v4/user/{user-id}/hosts](https://yandex.ru/dev/webmaster/doc/en/reference/hosts.md) method.

[*NO_SITEMAPS]: **Required**

Yes

**Type**

[ApiSiteProblemTypeEnum](#api-sites-problem-type)

**Description**

Problem.

[*severity]: **Required**

Yes

**Type**

`string` ([SiteProblemSeverityEnum](#site-problem-severity))

**Description**

Issue type

[*state]: **Required**

Yes

**Type**

`string` ([ApiSiteProblemState](#api-site-problem-state))

**Description**

State of the issue.

[*last_state_update]: **Required**

Yes

**Type**

`datetime`

**Description**

The date the issue status was last changed.

[*error_code]: **Description**

Error code.

[*available_user_id]: **Description**

ID of the user who allowed access.

[*error_message]: **Description**

Error message.

[*host_id]: **Description**

ID of the requested site.