Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

YouTube Video Captions

เอกสาร API
https://api.sandbase.ai/v1/api/youtube/video-captions

Get 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.

ราคา
$0.014286USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
1 จำเป็น · 2 ไม่บังคับ

Playground

อินพุต
The unique identifier for a YouTube video.
Caption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.
Caption output format.
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

YouTube Video Captions API

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.

Use cases

  • List which caption languages a video offers before you decide what to download.
  • Check whether a video has English captions before you queue it for transcription.
  • Build a language picker for a video player or localization tool from the track list.
  • Collect caption text in srt, xml, json3, or txt format for text analysis.

Request

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.

Parameters

NameTypeRequiredDescription
videoIdstringYesThe unique identifier for a YouTube video.
formatstringNoCaption output format.
languageCodestringNoCaption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.

Example response

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

Response fields

FieldMeaning
video_idThe 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_codeThe 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_nameThe language name for the track in English, such as English or German.

Notes

Pricing

$0.014286 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
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

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ YouTube Video Captions API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/youtube/video-captions โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

YouTube Video Captions API ราคาเท่าไร?

$0.014286 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

YouTube Video Captions API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: videoId (string). ตัวเลือก: languageCode (string) และ format (หนึ่งใน srt, xml, json3, txt). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

YouTube Video Captions API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ YouTube ไหม?

ไม่จำเป็น YouTube Video Captions ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง YouTube API แยกต่างหาก