Introduction

Attention. You opened the documentation for the API version 4.1. Documentation for the 3.2 version.

Yandex.Webmaster will no longer support version 3.2 or earlier as of the second half of 2020.

The application programming interface for the Yandex.Webmaster service (the Yandex.Webmaster API) allows developers to create applications for working with the user data stored in the Yandex.Webmaster service.

For example, you can use the Yandex.Webmaster API to let your users view and edit lists of their sites, add new sites, and get the status of site verification, indexing statistics and so on.

Use cases:

  • Creating a Yandex.Webmaster add-on for a hosting company's site management panel.
  • Creating applications for site management.
  1. How the API works
  2. Data exchange format
  3. API terms of use

How the API works

The Yandex.Webmaster API is a RESTful (Representational State Transfer) interface that uses HTTP and JSON/XML for data exchange.

The client application exchanges JSON or XML messages with the Yandex.Webmaster API server using HTTP requests in accordance with REST principles. Site resources and site lists are retrieved using the HTTP GET method, created using the HTTP POST method, and deleted using the HTTP DELETE method. See Overview of API resources.

The Yandex.Webmaster API is accessible to authenticated users at:

https://api.webmaster.yandex.net/

API requests can contain two types of parameters:

  • Path parameters — Parameters that are part of the resource URL.
  • Query parameters — Parameters added to the resource URL after the ? character.
Attention. For data exchange between the client application and the Yandex.Webmaster service, always use UTF-8 encoding.

Since most actions in the Yandex.Webmaster API are run on behalf of the user, the client application must be authorized.

In addition, the user ID must be specified when accessing API resources. You can get it when you start working by calling the user resource.

Data exchange format

API requests are made over the HTTPS protocol. By default, the service returns data in JSON. To get the XML response, pass the HTTP header Accept: application/xml in the request.

API terms of use

To get started with the Yandex.Webmaster API, the partner company must make an agreement with Yandex in the prescribed form and be assigned a client_id in the Yandex authorization system (oauth.yandex.com). The API can't be used without a client_id .

When registering a new partner account on the oauth.yandex.com server, you need the following data:

  • Application name — The name to show to users when they request access to their personal data.
  • Access to operations (these currently include adding the site and receiving information about the site).
  • Client application icon.
  • Client application link.
  • Callback URI — Link to the page to redirect the user to after they confirm access to their data. Available when the platform type is selected.
Attention. To get an access token, only one method may be used — Getting an access token by requesting user authorization.

Using the API to write end-user client applications assumes acceptance of the Yandex.Webmaster service terms of use. The client application actions must not contradict the rules set out in this document.

To perform actions with sites and site lists that require mandatory authorizations, the end user of the client application must agree to the Yandex.Webmaster service user agreement. The client application must explicitly inform the user of this requirement.