---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://yandex.ru/dev/direct/doc/en/intro.md
  - https://yandex.ru/dev/direct/doc/ru/intro.md
sourcePath: en/start/intro.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/direct/doc/en/llms.txt

# Lesson 1. What is Yandex Direct API



In this lesson, we will explain why Yandex Direct needs an API, and introduce you to the basics of its operation.

_Yandex Direct_ is a unified platform for running contextual and display ads. Yandex Direct serves your ads to the target audience of your business, interested in your products or services.

![](_assets/intro_start.png)

To work with Yandex Direct, all you need to do is to open a web interface, create an account, and place your ads. After that, you can manage your Yandex Direct campaigns not only through the web interface but also via the API.

{% note tip %}

If you're new to Yandex Direct, we recommend that you first take the [How to place an ad in Yandex Direct](https://yandex.ru/adv/edu/direct-start) online course and read [Help](https://yandex.com/support/direct/en/). This will help you understand the general principles of creating and managing campaigns so you can better master our API course.

{% endnote %}

## What is an API? {#intro_whats_api}

_API_ stands for an application programming interface. The API of a service provides a set of pre-built procedures, functions, and structures that developers can use to create their programs, applications, and scripts (hereinafter referred to as apps) to interact with the service.

In other words, the API is a constructor that has a set of building blocks (functions and methods) and rules how to use them. You can build your own application based on such building blocks.

![](_assets/intro_lego_scheme.png)

When interacting with the service via the API, the application sends a request to the service and gets a response containing the data  requested. The API lets you automate the workflow of operations that you perform in the web interface.

## Why do I need Yandex Direct API {#intro_forwhat_api}

Using the Yandex Direct API, you can manage the same advertising and promotional content as via the web interface. The API allows you to automate routine operations, accelerate their execution, and hence boost your account management efficiency. The API is the right choice if you need to handle large volumes of data, manage your ads outside of the web interface, and fine-tune your campaigns.

![](_assets/intro_for_what.png)

You can create an app for your tasks as an independent developer, advertiser, or advertising agency. For example, you can write a script to update bids based on your custom algorithm via the API automatically. You can integrate your corporate information system with Yandex Direct: upload a large number of ads from your database to Yandex Direct, automatically update ad texts as your product price changes, and stop and resume ad serving depending on product availability in stock. You can export daily statistics on campaigns to your analytical or finance system.

You can connect to and use the Yandex Direct API for free.

## Where to start {#intro_begining}

To complete the course, you need to create an account in Yandex Direct. If you do not have an account yet, then create it:

1. Log in to Yandex with the username you are going to use as an app developer. If you don't have a Yandex username, get one.
1. In Yandex Direct web interface ([https://direct.yandex.com](https://direct.yandex.ru/)) click the **Get started** button.
1. Enter an email address you currently use, select your country and currency. Click **Start using the service**.
1. Create your first campaign. We recommend selecting “Text & Image ads” campaign type. Specify the campaign parameters and create your first ad. For now, it is sufficient to create one draft ad with a single keyword. You don't need to submit ads for review or deposit money for the campaign.

{% note info %}

For instructions on how to create an account in Yandex Direct, see [Help](https://yandex.com/support/direct/en/quick-start/create-campaign.html). We also recommend that you take the [lesson](https://yandex.ru/adv/edu/direct/direct-start/kak-zavesti-akkaunt-v-direkte) on this in Yandex Direct course.

{% endnote %}

Now you have an account in Yandex Direct. Let's see what your advertising and promotional content looks like in the web interface and in the API.

## Objects in the web interface and API {#intro_objects}

 A Yandex Direct campaign consists of ad groups, and each ad group contains ads and keywords. Ads can include additional elements, such as images, site links, and others.

![](_assets/intro_adv_screenshot.png)

Links between objects in the API is shown in the diagram:

![](_assets/intro_objects_scheme.png)

- `Campaign` — promotion campaign, `AdGroup` — ad group, `Ad` — ad.
- Ad extensions: `AdImage` — an image, `VCard` — a virtual business card, `SitelinksSet` — a set of sitelinks, `AdExtension` — a callout.
- Ad group targeting criteria: `Keyword` — keyword (and others, depending on the campaign type). You can set a bid for a targeting criteria — `KeywordBid`.

![](_assets/intro_objects_screenshot.png)

## Task {#task}

Go through the settings of your campaign in Yandex Direct. Create new ads with different parameters. If you do not want to launch a real campaign, do not submit your ad groups for moderation to keep your ads in the "Draft" status.

[Complete a task](https://direct.yandex.ru/)

## What an API request looks like {#intro_request}

You can retrieve the advertising and promotional content you see in the web interface using API requests. You can also make changes using API requests, and see the result immediately reflected in the web interface. The API works with each object individually: different API methods allow you to create an ad, update a vCard, get statistics, and more.

Here is a sample API request for retrieving a user's campaign list. The request is sent using the HTTPS protocol's POST method.

![](_assets/intro_request.png)

In the next lessons, you will step through all the initial steps of working with the API:

- You will learn how to get access to the API: register your application with Yandex OAuth service, apply for access, and get an OAuth token.
- Also, you will learn to set up Sandbox: a testing debug environment for your app.
- You will learn to write API requests: you will get familiar with services and methods provided by the API and learn request structure details.
- Finally, here are a few tips on transitioning from testing in the Sandbox to working with advertising and promotional content for real users.

We strongly recommend that you go through the lessons in their native order. Previous lesson information (and results of actions you performed there) are prerequisite for each next lesson.

Best of luck!

## Useful links {#intro_usfull_links}

- [Yandex Direct: Tutorial](https://yandex.ru/adv/edu/direct-start)
- [Yandex Direct Help](https://yandex.com/support/direct/en/)

<!--
## Вопросы {#intro_questions}

1. **Для работы с API необходим аккаунт в Директе. Что нужно сделать для создания аккаунта в Директе?**

{% list tabs radio %}

- Зарегистрироваться на Яндексе.

  ![](_assets/incorrect.png) Неверно.

- Зарегистрироваться на Яндексе, <br/>
  в веб-интерфейсе Директа нажать кнопку "Запустить рекламу", <br/>
  выбрать страну и валюту, нажать кнопку <br/>
  "Начать пользоваться сервисом".

  ![](_assets/correct.png) Верно!

- Зарегистрироваться на Яндексе и посетить страницу https://direct.yandex.ru — аккаунт в Директе создается автоматически.

  ![](_assets/incorrect.png) Неверно.

{% endlist %}

1. **Что можно делать с помощью API Директа?**

    {% list tabs radio %}

    - Добавлять новые возможности в веб-интерфейс Директа.

      ![](_assets/incorrect.png) Неверно.

    - Автоматизировать процессы работы с Директом.

      ![](_assets/correct.png) Верно!

    - Изменять функциональность Директа так, как того хочет пользователь.

      ![](_assets/incorrect.png) Неверно.

    {% endlist %}

1. **Если вы внесете изменения в рекламную кампанию через API Директа, то где они будут отображены?**

    {% list tabs radio %}

    - Изменения будут отображены только в API.

      ![](_assets/incorrect.png) Неверно.

    - Изменения будут отображены только в веб-интерфейсе Директа.

      ![](_assets/incorrect.png) Неверно.

    - Изменения будут отображены как в API, так и в веб-интерфейсе Директа.

      ![](_assets/correct.png) Верно!

    {% endlist %}
-->
