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.
ВыходГотово

Ваш результат появится здесь

Заполните входные данные, затем нажмите «Запустить».

README по API

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

Как использовать API YouTube Video Transcript?

Отправьте POST-запрос на https://api.sandbase.ai/v1/api/youtube/video-transcript, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.

Сколько стоит API YouTube Video Transcript?

От $0.0009 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.

Какие параметры принимает API YouTube Video Transcript?

Параметры не требуются. Необязательные: id (string) и url (string). В таблице Parameters и в Playground на этой странице перечислены все поля.

Что возвращает API YouTube Video Transcript?

JSON-ответ, возвращаемый в том же HTTP-запросе (синхронно). В README на этой странице приведен пример ответа.

Нужен ли мне аккаунт разработчика YouTube или API key?

Нет. YouTube Video Transcript работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API YouTube.