API access

App authorization in Yandex Directory API occurs via the OAuth 2.0 protocol. OAuth 2.0 allows apps to access Yandex services on behalf of a user. Access rights for each app are explicitly restricted by the rights issued when the app is registered. Read about the basic OAuth principles and Yandex protocol implementation in OAuth authorization. Developer's guide.

To access Yandex Directory API:

  1. Register the app on the Yandex OAuth server.

    When registering your app, please specify the necessary access rights. Afterwards, the app can only make the API requests you specified during registration.

  2. Get an OAuth token one of the following ways:

    • Send a token POST request in exchange for the code returned by Yandex Oauth.

    • Extract the token from the URL hash (the part of the URL following the #).

      This method is described in the mobile, desktop, and web app instructions.

  3. Configure sending API requests according to the proper format.