videoIdstringобязательно
The unique identifier for a YouTube video.
https://api.sandbase.ai/v1/api/youtube/video-captionsGet available caption tracks for a YouTube video or request captions in SRT, XML, JSON3, or plain-text format. Use it to support transcription, accessibility, localization, or text analysis.
Ваш результат появится здесь
Заполните входные данные, затем нажмите «Запустить».
This API returns the caption tracks available for a YouTube video. It needs a videoId. If you also pass languageCode, it returns the captions for that language in the format you set with format.
srt, xml, json3, or txt format for text analysis.curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-captions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"videoId": "dQw4w9WgXcQ"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
videoId | string | Yes | The unique identifier for a YouTube video. |
format | string | No | Caption output format. |
languageCode | string | No | Caption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"captions": [
{
"language_code": "en",
"language_name": "English"
}
],
"video_id": "dQw4w9WgXcQ"
}
| Field | Meaning |
|---|---|
video_id | The ID of the video the caption tracks belong to. It matches the videoId you sent. |
captions[] | One entry for each caption track available for the video. |
captions[].language_code | The code for the track language, such as en, de, or ja. Pass this value as languageCode to request the captions for that track. |
captions[].language_name | The language name for the track in English, such as English or German. |
videoId to get the list of tracks. Add languageCode to request the caption content.format accepts srt, xml, json3, or txt. The default is srt.videoId from a video URL, or from YouTube Search or YouTube Channel Videos.$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Начните разработку
Конечная точка платформенного API с единообразной аутентификацией и учётом использования.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-captions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "srt",
"videoId": "dQw4w9WgXcQ"
}'Укажите свой ключ SandBase API в окружении сервера. Запросы используют аутентификацию Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Храните ключ на сервере. Не раскрывайте его в коде браузера.
videoIdstringобязательноThe unique identifier for a YouTube video.
languageCodestringCaption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.
formatstringCaption output format.
По умолчанию: "srt"
Возможные значения: srt, xml, json3, txt
Сохранённый пример ответа для этого API; при просмотре живой запрос не выполняется.
Сохранённый ответ не опубликован. Запустите API в Playground, чтобы посмотреть его ответ.
Посмотреть больше
| API | Цена | Ответ |
|---|---|---|
YouTube Video CaptionsЭтот API YouTube | $0.014286 за запрос | JSON |
YouTube | От $0.00045 за запрос | JSON |
YouTube | От $0.0012 за запрос | JSON |
YouTube | От $0.0012 за запрос | JSON |
YouTube | От $0.0012 за запрос | JSON |
YouTube | $0.014286 за запрос | JSON |
Руководства:Best YouTube API in 2026: Pricing Compared
Вопросы
Отправьте POST-запрос на https://api.sandbase.ai/v1/api/youtube/video-captions, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.
$0.014286 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.
Обязательные: videoId (string). Необязательные: languageCode (string) и format (один из srt, xml, json3, txt). В таблице Parameters и в Playground на этой странице перечислены все поля.
JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.
Нет. YouTube Video Captions работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API YouTube.