What do you want to ask Support about?
Use cases and features of the Yandex Direct API are described in detail in the documentation. If you didn't find the answer to your question, contact our experts — we are always ready to help.
Choose a question from the list below or to the left. After choosing the relevant topics, you will see either an answer to your question or a contact form.
- When calling a Yandex Direct API method, an error occurs
- Request for access
- Restrictions when working with the Yandex Direct API
- Access to register new agency clients via the API
- Make a suggestion or leave a comment
- Other questions about the Yandex Direct API
Questions about using the Yandex Direct API
The API for the Yandex Direct service provides programmatic access to data and enables you to create applications for managing advertising campaigns. External applications use the API to add and edit campaigns, ads, and keywords, and to set bids.
The Yandex Direct API is intended primarily for advertising agencies and direct advertisers — commercial firms, companies in the service industry, and others. They develop their own applications in order to fully implement their own approaches to running advertising campaigns.
The features and options of the programming interface are described in detail in the documentation.
All changes made via the API are reflected in your advertising campaigns.
Since different companies have different approaches to managing advertising, various solutions have appeared on the market for managing advertising based on the Yandex Direct API.
Many advertising agencies offer their clients tools for automated management of ads in Yandex Direct, and also use these tools to optimize their own processes. All of these solutions are based on Yandex Direct API methods.
Yandex also has solutions based on the Yandex Direct API:
- The Direct Commander program is intended for management of large-scale advertising campaigns in a convenient interface.
Requests to the Yandex Direct API are made over the HTTPS protocol using the POST method. Input and output data structures are passed in the body of the request and response.
The Yandex Direct API supports two formats: JSON and SOAP.
Authentication uses the OAuth 2.0 protocol: requests must specify the access token.
Both connection to the Yandex Direct API and usage are free of charge.
An application (program, script, or other type of app) sends an API request on behalf of a Yandex Direct user — a representative of an advertiser or advertising agency — and manages this user's data.
The app can access a user's data under the following conditions:
The app developer completed the application registration process, and the request for access was approved.
The user has a Yandex Direct account and represents a direct advertiser, an advertising agency, or a client of an advertising agency, who was granted access to the data by the agency.
Note.If the agency granted the client read-only access to the web interface, the client's representative can only get data when using the API, as well.
If the agency granted the client permission to edit campaigns, the client's representative can use either the web interface or the API for managing the client's campaigns.
- The user has accepted the user agreement on the Yandex Direct API service page.
The user has allowed the app to make requests.
The app must request permission from the user to access data, get an access token, and specify the token in requests.
To get a token, the application must redirect the user to the access request page. The user logs in on Yandex (using the username for Yandex Direct) and clicks the Confirm button. Next, the Yandex server generates a token and sends it to the app.
- Getting a token manually
-
At the app debugging stage, you can get a so-called debugging token in the name of a test user. See the section Debugging token in the Yandex OAuth guide.
- Getting a token automatically
-
When you are ready to begin working with real user data, you need to implement a user-friendly way to get tokens in the application. To get a token, the application should redirect the user to a special access request page, Yandex OAuth. The user logs in on Yandex (with the username for Yandex Direct) and clicks the Allow button to grant the application access to personal data. Yandex OAuth generates a token and transmits it to the application automatically.
Yandex OAuth supports multiple ways to transmit the token that are suitable for different types of applications: web services, desktop programs, mobile apps, and others. The flow for getting a token is covered in detail in the OAuth guide.
See also: PHP example, Python example.
- Which method should I choose for getting a token?
-
In some cases, you can use tokens that you obtain manually after you switch to working with real user data. For example:
If the application only has a small number of users, who are representatives of a single advertiser.
If the application doesn't interact with the user. For example, this is a script for automatically updating bids.
Tokens should be obtained automatically if the application is accessed by multiple advertisers or a large number of users with different access rights.
A token might become invalid if, for example, the user's password changed on Yandex. For a complete list of reasons, see the section Revoking tokens in the Yandex OAuth guide. In this case, a new token must be obtained.
If you are using an application, we recommend that you register a special representative in Yandex Direct and get a token for the representative. See Recommendations for registering representatives.
Your daily limit of points depends on the activity of advertising campaigns — the number of impressions and clicks, and resulting expenditures.
If the number of impressions and clicks isn't growing much or campaigns are short on funds, frequent and large API requests create an unreasonable load on the Yandex Direct servers. The daily limit is calculated using a grid of budget thresholds based on statistics for different types of campaigns.
The daily limit is re-calculated once a day.
See also
For detecting errors and debugging, sometimes you need to output the client's SOAP request and the server's SOAP response.
For Perl:
my $client = SOAP::Lite->service($client->on_debug(sub {print @_}));
Check whether the following conditions are met:
If all these conditions are met, ad displays for the keyword are possible. However, this does not guarantee that displays are occurring at this time. Common reasons for lack of displays:
- The campaign is currently being activated.
- Displays are automatically suspended according to the daily budget settings or an automatic strategy.
- Displays are automatically suspended according to time targeting settings.
For more information, see the section Display problems in the Help for Direct.
A list of changes by API version is provided in the following sections:
- For version 5, in API version 5. History of changes.
- For version Live 4, in Version Live 4 (deprecated).
We also notify you of changes to the Yandex Direct API in the official blog. To get notifications about new posts, subscribe.
The documentation for version 4 and Live 4 is at https://tech.yandex.com/direct/doc/dg-v4.
For information about changes in version 5 compared to previous versions and a list of equivalents for methods and their parameters, see the Migration guide.