---
metadata:
  - name: generator
    content: Diplodoc Platform v5.48.2
alternate:
  - https://admin.contest.yandex.ru/docs/en/api-access.md
  - https://admin.contest.yandex.ru/docs/ru/api-access.md
---
> **Documentation Index:** Fetch the complete configuration index at https://admin.contest.yandex.ru/docs/en/llms.txt

# Yandex Contest API

In addition to the admin panel interface, Yandex Contest provides a public API that allows you to:

* register contest participants;

* manage user groups;

* get information about contests and problems;

* submit and rejudge solutions;

* export leaderboard data and much more.

The current public API methods are available on the [interactive API page (Swagger UI)](https://api.contest.yandex.net/api/public/swagger-ui.html).

## Creating a Yandex ID application {#create-app}

An OAuth token allows you to interact with Yandex services on behalf of a specific user. To call Yandex Contest public API methods, create an application in [Yandex ID](https://yandex.ru/dev/id/doc/en/) and get an OAuth token:

1. Log in to the [new application creation page](https://oauth.yandex.ru/client/new/) with your Yandex ID.

1. Fill in the data and click **Create**.

    Specify your contact email. Notifications will be sent to this address if API changes affect your application.

1. Select access permissions for the application.

    Yandex Contest has two types of permissions:

    * **Submitting and testing solutions in contests** (`contest:submit`) — actions on behalf of a participant, for example:
        * submitting solutions;
        * viewing your position in the leaderboard.

    * **Managing contests and participants** (`contest:manage`) — actions on behalf of an administrator, for example:
        * viewing all submissions;
        * rejudging solutions;
        * managing groups.

1. Remember the `client_id` of the created application, you will need it when getting the OAuth token.

## Getting an OAuth token in Yandex ID {#get-oauth-token}

The process of obtaining a token depends on the platform and method of accessing the Contest API through Yandex ID authorization. See [Application registration](https://yandex.ru/dev/id/doc/en/register-client) and [Getting an OAuth token](https://yandex.ru/dev/id/doc/en/access) in the Yandex ID documentation.

## Using API methods {#use-api}

For authorization, add the `Authorization` header with the value `OAuth <token>`, where `<token>` is the obtained OAuth token without brackets and quotes.

Request example:

```bash
# Replace ABCD_some_imaginary_oauth_token_for_example_XYZ with your real token
curl -X GET "https://api.contest.yandex.net/api/public/v2/service/capacity" -H "accept: application/json" -H "Authorization: OAuth ABCD_some_imaginary_oauth_token_for_example_XYZ"
```

### Testing API methods {#debug-api}

To create test requests, go to the [interactive API page (Swagger UI)](https://api.contest.yandex.net/api/public/swagger-ui.html). To send a request:

1. [Create an application in Yandex ID](#create-app) and [get an OAuth token](https://yandex.ru/dev/id/doc/en/access). For testing purposes, you can use a [debug token](https://yandex.ru/dev/id/doc/en/tokens/debug-token).

1. At the top of the page, click **Authorize**.

1. In the **Available authorizations** window, enter the OAuth token in the **Value** field.

1. Click the **Authorize** button.

1. Click **Try it out** inside any method and fill in the request parameters.

1. Click **Execute**.

You can now work with Yandex Contest public API methods and modify request parameters to get the data you need.

## See also

For more information about Yandex ID, see the [Yandex ID documentation](https://yandex.ru/dev/id/doc/en/).
