Sand AISand AI MAGI-2MAGI-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 / कॉल
मेथड
POST
प्रतिक्रिया
JSON
पैरामीटर
0 आवश्यक · 2 वैकल्पिक

प्लेग्राउंड

इनपुट
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

प्रश्न

FAQ

YouTube Video Transcript API का उपयोग कैसे करें?

https://api.sandbase.ai/v1/api/youtube/video-transcript पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।

YouTube Video Transcript API की लागत कितनी है?

$0.0009 से प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।

YouTube Video Transcript API कौन-से parameters स्वीकार करती है?

कोई parameters आवश्यक नहीं हैं। वैकल्पिक: id (string) और url (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।

YouTube Video Transcript API क्या लौटाती है?

एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।

क्या मुझे एक YouTube developer account या API key चाहिए?

नहीं। YouTube Video Transcript SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से YouTube API access के लिए आवेदन करने की आवश्यकता नहीं है।