Sand AISand AI MAGI-2MAGI-2가 이제 SandBase에서 제공됩니다: 네이티브 오디오가 포함된 1080p 동영상지금 사용해 보기

YouTube Video Captions

API 문서
https://api.sandbase.ai/v1/api/youtube/web-v2/video-captions

Returns available video caption tracks or transcripts in multiple formats, filtered by video identifier and language code.

가격
$0.008USD / 호출
메서드
POST
응답
JSON
매개변수
필수 0개 · 선택 사항 4개

Playground

입력
Caption format
Language code (e.g. en, zh-Hans, a.en), returns available caption list if empty
Video ID (recommended)
Full video URL (optional)
출력예시
응답outputs · 805 B · 11줄
[
  {
    "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 README

YouTube Video Captions API

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.

Use cases

  • Pull English subtitles as txt to feed a video summarization workflow.
  • Download srt files with timestamps to build subtitles for a re-upload or translation.
  • Fetch json3 captions to index spoken words for search.
  • Check which caption languages a video offers before choosing one to download.

Request

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.

Parameters

NameTypeRequiredDescription
formatstringNoCaption format
language_codestringNoLanguage code (e.g. en, zh-Hans, a.en), returns available caption list if empty
video_idstringNoVideo ID (recommended)
video_urlstringNoFull video URL (optional)

Example response

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"
}

Response fields

FieldMeaning
contentThe 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.
formatThe caption format of content, matching the format you requested.
language_codeThe language code of the returned captions, for example en.
language_nameThe readable name of the caption language, for example English.
video_idThe ID of the video the captions belong to.

Notes

  • Send video_id when you can. video_url is optional and is not needed if you have the ID.
  • The video_id is the value after v= in a watch URL, for example dQw4w9WgXcQ.
  • Language codes can be plain, like en or zh-Hans, or auto-generated tracks like a.en.
  • format defaults to srt when you leave it out.

Pricing

$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

모든 API
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

가이드:Best YouTube API in 2026: Pricing Compared

질문

FAQ

YouTube Video Captions API를 어떻게 사용하나요?

Authorization 헤더(Bearer)에 SandBase API 키를 넣고, 매개변수를 JSON 본문으로 담아 https://api.sandbase.ai/v1/api/youtube/web-v2/video-captions에 POST 요청을 보내세요. 이 페이지의 Playground에서도 코드를 작성하지 않고 직접 테스트할 수 있습니다.

YouTube Video Captions API 비용은 얼마인가요?

호출당 $0.008, SandBase 잔액에서 청구됩니다. 사용한 호출에 대해서만 요금이 부과되며, 구독은 없습니다.

YouTube Video Captions API는 어떤 매개변수를 받나요?

비디오를 식별하려면 video_id 또는 video_url을 제공하세요. language_code를 비워 두면 사용 가능한 자막 트랙이 나열되며, 이후 해당 비디오에 대해 반환된 언어 코드를 사용해 콘텐츠를 가져올 수 있습니다. 선택 사항인 format 매개변수는 srt, xml, json3 또는 txt를 허용합니다. 현재 요청 세부 사항은 README와 Playground를 참조하세요.

YouTube Video Captions API는 무엇을 반환하나요?

같은 HTTP 요청에서 반환되는 JSON 응답입니다(동기식). 이 페이지의 README에 샘플 응답이 포함되어 있습니다.

YouTube 개발자 계정이나 API 키가 필요한가요?

아니요. YouTube Video Captions은 SandBase를 통해 실행되므로, SandBase API 키 하나로 이 엔드포인트와 카탈로그의 다른 모든 API 및 모델을 사용할 수 있습니다. YouTube API 액세스를 별도로 신청할 필요는 없습니다.