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

YouTube Video Transcript

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

Fetch the transcript/captions of a YouTube video or Short by URL or ID.

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

Playground

อินพุต
YouTube video ID. A Short uses the same ID as any other video.
Full YouTube video URL. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work.
เอาต์พุตพร้อมใช้งาน

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

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

API README

YouTube Video Transcript API

Returns the transcript of a YouTube video or Short as plain text and as timed segments. You pass either a video url or a video id.

Use cases

  • Index what a video says so you can search across many videos by spoken words.
  • Feed the transcript text into a summarizer or a question-answering tool.
  • Build subtitles or clickable timestamps from the timed segments.
  • Check whether a video mentions a brand, product, or phrase.

Request

curl -X POST "https://api.sandbase.ai/v1/api/youtube/video-transcript" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
idstringNoYouTube video ID. A Short uses the same ID as any other video.
urlstringNoFull YouTube video URL. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "language": "en",
    "segments": [
      {
        "durationSeconds": 1.68,
        "startSeconds": 1.36,
        "text": "[♪♪♪]"
      }
    ],
    "transcript": "[♪♪♪]\n♪ We're no strangers to love ♪\n♪ You know the rules and so do I ♪\n♪ A full…"
  },
  "found": true
}

Response fields

FieldMeaning
foundtrue when a transcript was found for the video. A lookup that finds nothing returns found: false.
data.languageLanguage code of the transcript, for example en.
data.transcriptThe full transcript as one string. Each caption line is separated by a newline.
data.segments[].textThe text of one caption line. Music cues such as [♪♪♪] can appear as text.
data.segments[].startSecondsStart time of the segment, in seconds from the beginning of the video.
data.segments[].durationSecondsHow long the segment lasts, in seconds.

Notes

  • Send either url or id. A Short uses the same ID as any other video, and youtube.com/shorts/..., youtu.be, live, and embed URLs all work for url.
  • The id is the value after v= in a standard watch URL, for example dQw4w9WgXcQ.
  • Use data.transcript for the whole text and data.segments when you need timing.
  • To get video metadata such as title and stats, call YouTube Video Details.

Pricing

Billed at the actual cost of each call, about $0.0009 for the request above. Failed calls are not charged.

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

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

APIs ทั้งหมด
APIราคาการตอบกลับ
YouTubeเริ่มต้นที่ $0.0009 ต่อครั้ง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 Transcript API ได้อย่างไร?

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

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

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

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

ไม่ต้องระบุพารามิเตอร์ ตัวเลือก: id (string) และ url (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

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

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

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

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