---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://yandex.ru/dev/kit/ru/openapi/Video/GetVideoById.md
  - href: ru/openapi/Video/GetVideoById.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/kit/ru/llms.txt

<div class="openapi">

# Получение видео по идентификатору

<!-- markdownlint-disable-file -->

Возвращает видео и текущий статус его обработки.

Используйте метод, чтобы дождаться готовности видео после загрузки: статус меняется
`UPLOADED` → `PROCESSING` → `READY`. В статусе `READY` заполнено поле `content`
со ссылкой на плеер, в статусе `ERROR` — поле `error` с описанием ошибки.

Опрашивайте метод не чаще одного раза в 5 секунд: обработка занимает время,
пропорциональное длительности видео, а на магазин действует общий лимит запросов.

Видео в статусе `ERROR` удаляются автоматически, после удаления метод возвращает `404`.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-get);margin-bottom: 12px">

<div class="openapi__request">

GET {.openapi__method}
```text translate=no
https://api.kit.yandex.net/v1/videos/{video_id}
```

</div>

</div>

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

Видео

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "id": "vplvusemmooxmhpwiqli",
  "status": "UPLOADED",
  "title": "promo.mp4",
  "created_at": "2020-01-01T00:00:00Z",
  "content": {
    "player_url": "https://example.com/player/vplvusemmooxmhpwiqli",
    "first_frame_url": "https://example.com/first-frame.jpg",
    "duration_seconds": 15
  },
  "error": {
    "code": "TRANSCODING_FAILED",
    "message": "Не удалось обработать видео"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_created_at_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Дата загрузки видео

_Example:_{.json-schema-reset .json-schema-example} `2020-01-01T00:00:00Z`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [VideoID](#entity-VideoID)

Идентификатор видео.

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

_Example:_{.json-schema-reset .json-schema-example} `vplvusemmooxmhpwiqli`
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [VideoStatus](#entity-VideoStatus)

Статус обработки видео:
- `UPLOADED` — видео загружено и поставлено в очередь на обработку.
- `PROCESSING` — видео обрабатывается.
- `READY` — видео готово к показу, заполнено поле `content`.
- `ERROR` — обработка завершилась ошибкой, детали в поле `error`.

_Enum:_{.json-schema-reset .json-schema-value} `UPLOADED`, `PROCESSING`, `READY`, `ERROR`
{.table-cell}
||
||

_title_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Название видео. Совпадает с именем загруженного файла.

_Example:_{.json-schema-reset .json-schema-example} `promo.mp4`
{.table-cell}
||
||

_content_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **Type**: [VideoContent](#entity-VideoContent)

  Ссылки на готовое видео.

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "player_url": "https://example.com/player/vplvusemmooxmhpwiqli",
    "first_frame_url": "https://example.com/first-frame.jpg",
    "duration_seconds": 15
  }
  ```

  {% endcut %}

{% endcut %}

Ссылки на видео. Заполняется только в статусе `READY`.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "player_url": "https://example.com/player/vplvusemmooxmhpwiqli",
  "first_frame_url": "https://example.com/first-frame.jpg",
  "duration_seconds": 15
}
```

{% endcut %}
{.table-cell}
||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**All of 1 type**" %}{.json-schema-combinators data-marker=and}

- **Type**: [VideoError](#entity-VideoError)

  Ошибка обработки видео.

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "code": "TRANSCODING_FAILED",
    "message": "Не удалось обработать видео"
  }
  ```

  {% endcut %}

{% endcut %}

Описание ошибки обработки. Заполняется только в статусе `ERROR`.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "code": "TRANSCODING_FAILED",
  "message": "Не удалось обработать видео"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### VideoID {#entity-VideoID}

Идентификатор видео.

**Type**: string

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

_Example:_{.json-schema-reset .json-schema-example} `vplvusemmooxmhpwiqli`

</div>

<div class="openapi-entity">

### VideoStatus {#entity-VideoStatus}

Статус обработки видео:
- `UPLOADED` — видео загружено и поставлено в очередь на обработку.
- `PROCESSING` — видео обрабатывается.
- `READY` — видео готово к показу, заполнено поле `content`.
- `ERROR` — обработка завершилась ошибкой, детали в поле `error`.

**Type**: string

_Enum:_{.json-schema-reset .json-schema-value} `UPLOADED`, `PROCESSING`, `READY`, `ERROR`

</div>

<div class="openapi-entity">

### VideoContent {#entity-VideoContent}

Ссылки на готовое видео.

#|
|| **Name** | **Description** ||
||

_player_url_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;uri&gt;

Ссылка на плеер видео.

_Example:_{.json-schema-reset .json-schema-example} `https://example.com/player/vplvusemmooxmhpwiqli`
{.table-cell}
||
||

_duration_seconds_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Длительность видео в секундах.
{.table-cell}
||
||

_first_frame_url_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;uri&gt;

Ссылка на превью — первый кадр видео.

_Example:_{.json-schema-reset .json-schema-example} `https://example.com/first-frame.jpg`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "player_url": "https://example.com/player/vplvusemmooxmhpwiqli",
  "first_frame_url": "https://example.com/first-frame.jpg",
  "duration_seconds": 15
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### VideoError {#entity-VideoError}

Ошибка обработки видео.

#|
|| **Name** | **Description** ||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Описание ошибки.

_Example:_{.json-schema-reset .json-schema-example} `Не удалось обработать видео`
{.table-cell}
||
||

_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Код ошибки. Может отсутствовать — не используйте его как однозначный
признак причины сбоя.

_Example:_{.json-schema-reset .json-schema-example} `TRANSCODING_FAILED`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "code": "TRANSCODING_FAILED",
  "message": "Не удалось обработать видео"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Некорректный запрос.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__401">

## 401 Unauthorized

Не авторизован.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__404">

## 404 Not Found

Ресурс не найден.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__500">

## 500 Internal Server Error

Внутренняя ошибка сервера.

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "code": "VALIDATION_ERROR",
  "message": "Invalid input",
  "trace_id": "00000000000000000000000000000000"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_code_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `VALIDATION_ERROR`
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `Invalid input`
{.table-cell}
||
||

_trace_id_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Уникальный идентификатор запроса для отладки.

_Example:_{.json-schema-reset .json-schema-example} `00000000000000000000000000000000`
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.