formatstring
Caption format
기본값: "srt"
가능한 값: srt, xml, json3, txt
https://api.sandbase.ai/v1/api/youtube/web-v2/video-captionsReturns available video caption tracks or transcripts in multiple formats, filtered by video identifier and language code.
[
{
"data": {
"content": "1\n00:00:00,080 --> 00:00:04,000\nCloud flare has released an AI agents\n\n2\n00:00:01,880 --> 00:00:06,240\nSDK it's durable objects but with\n\n3\n00:00:04,000 --> 00:00:08,000\nsuperpowers this makes building agents\n\n4\n00:00:06,240 --> 00:00:09,880\nmuch much easier as it handles the\n\n5\n00:00:08,000 --> 00:00:12,000\ncomplex parts for you like persisting\n\n6\n00:00:09,880 --> 00:00:14,000\nState handling long running tasks and\n\n7\n00:00:12,000 --> 00:00:15,440\neven horizontal scaling this is just the\n\n8\n00:00:14,000 --> 00:00:17,080\nbeginning too the road map talks of\n\n9\n00:00:15,440 --> 00:00:19,119\naddin…",
"format": "srt",
"language_code": "en",
"language_name": "English",
"video_id": "l4tHKJFQvRg"
}
}
]예시를 선택하면 입력값과 결과가 플레이그라운드에 로드됩니다.
Returns the caption text of a YouTube video for one language, in the format you choose (srt, xml, json3 or txt). It needs a video_id or a video_url, plus a language_code. If you leave language_code empty, it returns the list of available caption tracks instead.
txt to feed a video summarization workflow.srt files with timestamps to build subtitles for a re-upload or translation.json3 captions to index spoken words for search.curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/video-captions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"video_id": "dQw4w9WgXcQ", "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "language_code": "en", "format": "srt"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
format | string | No | Caption format |
language_code | string | No | Language code (e.g. en, zh-Hans, a.en), returns available caption list if empty |
video_id | string | No | Video ID (recommended) |
video_url | string | No | Full video URL (optional) |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"content": "1\n00:00:01,360 --> 00:00:03,040\n[♪♪♪]\n\n2\n00:00:18,640 --> 00:00:21,880\n♪ We're n…",
"format": "srt",
"language_code": "en",
"language_name": "English",
"video_id": "dQw4w9WgXcQ"
}
| Field | Meaning |
|---|---|
content | The full caption text in the requested format. For srt, each cue has a number, a start and end time in HH:MM:SS,mmm form, and the caption line. Sound cues such as [♪♪♪] appear as text. |
format | The caption format of content, matching the format you requested. |
language_code | The language code of the returned captions, for example en. |
language_name | The readable name of the caption language, for example English. |
video_id | The ID of the video the captions belong to. |
video_id when you can. video_url is optional and is not needed if you have the ID.video_id is the value after v= in a watch URL, for example dQw4w9WgXcQ.en or zh-Hans, or auto-generated tracks like a.en.format defaults to srt when you leave it out.$0.008 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
video_id 또는 video_url을 제공하세요. 각 필드가 개별적으로 required로 표시되지 않더라도 비디오 입력은 필요합니다. 트랙을 찾으려면 language_code를 비워 두고, 반환된 언어 코드를 사용해 자막 내용을 가져오세요. 언어 선택, SRT 저장, 연구를 위한 출처 보존은 Python YouTube transcript 가이드를 참고하세요.
빌드를 시작하세요
통합 인증 및 사용량 추적이 있는 플랫폼 API 엔드포인트입니다.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/video-captions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "srt",
"video_id": "l4tHKJFQvRg",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"language_code": "en"
}'서버 환경에 SandBase API 키를 설정하세요. 요청에는 Bearer 인증이 사용됩니다.
export SANDBASE_API_KEY="YOUR_API_KEY"키는 서버에 보관하세요. 브라우저 코드에 노출하지 마세요.
formatstringCaption format
기본값: "srt"
가능한 값: srt, xml, json3, txt
language_codestringLanguage code (e.g. en, zh-Hans, a.en), returns available caption list if empty
video_idstringVideo ID (recommended)
video_urlstringFull video URL (optional)
이 API의 저장된 예시 응답입니다. 확인할 때 라이브 요청은 실행되지 않습니다.
[
{
"data": {
"content": "1\n00:00:00,080 --> 00:00:04,000\nCloud flare has released an AI agents\n\n2\n00:00:01,880 --> 00:00:06,240\nSDK it's durable objects but with\n\n3\n00:00:04,000 --> 00:00:08,000\nsuperpowers this makes building agents\n\n4\n00:00:06,240 --> 00:00:09,880\nmuch much easier as it handles the\n\n5\n00:00:08,000 --> 00:00:12,000\ncomplex parts for you like persisting\n\n6\n00:00:09,880 --> 00:00:14,000\nState handling long running tasks and\n\n7\n00:00:12,000 --> 00:00:15,440\neven horizontal scaling this is just the\n\n8\n00:00:14,000 --> 00:00:17,080\nbeginning too the road map talks of\n\n9\n00:00:15,440 --> 00:00:19,119\naddin…",
"format": "srt",
"language_code": "en",
"language_name": "English",
"video_id": "l4tHKJFQvRg"
}
}
]더 살펴보기
| API | 가격 | 응답 |
|---|---|---|
YouTube | $0.008 / 호출 | JSON |
YouTube | $0.001 / 호출 | JSON |
YouTube | $0.001 / 호출 | JSON |
YouTube | $0.001 / 호출 | JSON |
YouTube | $0.001 / 호출 | JSON |
YouTube | $0.001 / 호출 | JSON |
질문
Authorization 헤더(Bearer)에 SandBase API 키를 넣고, 매개변수를 JSON 본문으로 담아 https://api.sandbase.ai/v1/api/youtube/web-v2/video-captions에 POST 요청을 보내세요. 이 페이지의 Playground에서도 코드를 작성하지 않고 직접 테스트할 수 있습니다.
호출당 $0.008, SandBase 잔액에서 청구됩니다. 사용한 호출에 대해서만 요금이 부과되며, 구독은 없습니다.
비디오를 식별하려면 video_id 또는 video_url을 제공하세요. language_code를 비워 두면 사용 가능한 자막 트랙이 나열되며, 이후 해당 비디오에 대해 반환된 언어 코드를 사용해 콘텐츠를 가져올 수 있습니다. 선택 사항인 format 매개변수는 srt, xml, json3 또는 txt를 허용합니다. 현재 요청 세부 사항은 README와 Playground를 참조하세요.
같은 HTTP 요청에서 반환되는 JSON 응답입니다(동기식). 이 페이지의 README에 샘플 응답이 포함되어 있습니다.
아니요. YouTube Video Captions은 SandBase를 통해 실행되므로, SandBase API 키 하나로 이 엔드포인트와 카탈로그의 다른 모든 API 및 모델을 사용할 수 있습니다. YouTube API 액세스를 별도로 신청할 필요는 없습니다.