Hey!

In this article, we are reviewing the ways to get data about your account balance from Yandex.Direct advertising account. When holding a promotional campaign, it is important that the account always generates value, so tracking its balance is one of the most important tasks for ad agencies.

Usually, advertising agencies track their clients’ accounts using a system that can gather statistics on all clients in a single Power BI (or other data visualization tool) report. This is handy, as it helps manage all the current promotional activities for all your projects at once.

Let’s look at the two ways to get data on an account balance:

  1. Yandex.Direct API Connector by Renta

  2. Using queries to Yandex.Direct API.

A simple Yandex.Direct API Connector by Renta

Renta marketing ETL service supports automatic account balance export from advertising accounts, including agency accounts. The minimum refresh frequency is one minute and you can export the results to data warehouses like Google BigQuery.

To do this, you’ll need to create an integration with the following settings:

  1. Type of integration: Yandex.Direct

  2. Report Type: Account Balance Report

  3. Then just specify the rest of the parameters.

For example: Login, AccountId, Amount, and Currency:

Where:

  • Login is the advertising account login,

  • AccountId is the advertising account identifier,

  • The amount is the account balance,

  • Currency is the account currency

As a result, a table with the requested data will be created in Google BigQuery:

Data from Google BigQuery can be exported to Power BI, Tableau, or any other BI tool. Instead of Google BigQuery, you can also use other data warehouses, including ClickHouse, SQL Server, and Amazon Redshift.

The cost of Yandex.Direct API Connector created by Renta marketing ETL service is $ 39 / month.

Using a direct query

Let’s have a look at an example of a query to Yandex.Direct API you can use to get the balance data from an advertising account.

  • API method: AccountManagement

  • Request format: json

    https://api.direct.yandex.ru/live/v4/json/
    {
       "method": "AccountManagement",
       "token": "your_token",
       "param": {
          "Action": "Get",
          "SelectionCriteria": {
             "Logins": [],
             "AccountIDS": [17112490]
          }
       }
    }

    The sample query above can be used for regular accounts. If you have an agency account, then:

    • Logins must contain an agency account login

    • AccountIDs can remain empty.

    In this case, you will receive data on all advertisers in your agency account. If you choose to specify the IDs, you will get data only on those accounts. That is, AccountIds can be used as a data filter.

    If you execute the query above, Yandex.Direct API will return the answer:

    {
        "data": {
            "Accounts": [
                {
                    "AmountAvailableForTransfer": "869.47",
                    "SmsNotification": {
                        "SmsTimeTo": "23:00",
                        "SmsTimeFrom": "08:00",
                        "PausedByDayBudgetSms": "Yes",
                        "MoneyInSms": "Yes",
                        "MoneyOutSms": "Yes"
                    },
                    "Amount": "1085.7",
                    "EmailNotification": {
                        "Email": "yadirect@renta.im",
                        "MoneyWarningValue": 20,
                        "PausedByDayBudget": "Yes",
                        "SendWarn": null
                    },
                    "Currency": "EUR",
                    "Login": "renta",
                    "Discount": 0,
                    "AgencyName": null,
                    "AccountID": 17112490
                }
            ],
            "ActionsResult": []
        }
    }

    Now you only need to parse the answer and send the results to a data warehouse of your choice.

    Some useful links:

  • Renta account creation, the setup process will take about 5 minutes and you’ll also be able to use a 7-days trial.

  • OAuth authorization manual, which you will need to obtain tokens for API queries.

    If you have any questions, just post them in the comments. We will be happy to answer!