YouTube API

YouTube Transcript API

Send a video URL and get its transcript back as JSON. Plain text for AI and search, timed segments for players, or a ready SRT or WebVTT file.

  • 100 free credits
  • No card needed
  • No Google Cloud project or OAuth
curl "https://pipefetch.com/v1/youtube/transcript?video=jNQXAC9IVRw" \
  -H "x-api-key: YOUR_API_KEY"
The response

What you get

  • The full transcript as one text, with its word count
  • Timed segments: start, duration and text
  • The caption language, whether it is auto-generated, and every language the video offers
  • Chapters, when the video has them
  • The video title, channel, duration and publish date
200 OK · application/json
{
  "data": {
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "channel": {
      "id": "UC4QobU6STFB0P71PMvOGN5A",
      "name": "jawed",
      "handle": "@jawed",
      "url": "https://www.youtube.com/@jawed"
    },
    "publishedAt": "2005-04-23",
    "durationSeconds": 19,
    "language": "en",
    "languageName": "English",
    "isAutoGenerated": false,
    "isPreferredLanguage": true,
    "availableLanguages": [
      {
        "code": "en",
        "name": "English",
        "isAutoGenerated": false
      },
      {
        "code": "de",
        "name": "German",
        "isAutoGenerated": false
      }
    ],
    "format": "text",
    "text": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's …",
    "wordCount": 39,
    "segments": [
      {
        "start": 1.2,
        "duration": 2.16,
        "text": "All right, so here we are, in front of the elephants"
      },
      {
        "start": 5.318,
        "duration": 2.656,
        "text": "the cool thing about these guys is that they have really..."
      }
    ],
    "chapters": [
      {
        "title": "Intro",
        "startSeconds": 0,
        "endSeconds": 5
      },
      {
        "title": "The cool thing",
        "startSeconds": 5,
        "endSeconds": 17
      }
    ]
  },
  "credits": {
    "used": 1,
    "remaining": 99
  }
}
Reference

One GET request

Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.

GET/v1/youtube/transcript

Costs 1 credit per request. Only requests that return data are charged.

Parameters

NameTypeDescription
videorequired string Video URL or 11-character video id. Watch, youtu.be, Shorts, embed and live links all work.
langoptional string Preferred caption language code, such as en, es or pt-BR. Without it you get the video's original language.
formatoptional string What the text field holds: plain text, text with [0:12] timestamps, or a ready SRT or WebVTT file. One of: text, timestamped, srt, vtt. Default: text.
segmentsoptional boolean Include the list of timed segments (start, duration, text). Default: true.

Good to know

  • Uploaded captions are preferred over auto-generated ones. isAutoGenerated tells you which one you got.
  • If the language you asked for does not exist, another one is returned and isPreferredLanguage is false.
  • A video without captions answers 404 no_transcript and costs nothing.

Open the reference

Use cases

What people build with it

  • Feed videos to an LLM

    Summaries, question answering and retrieval over video content start with clean text. The plain format is made for that.

  • Search inside videos

    Index the timed segments and link your users straight to the second where something is said.

  • Subtitles and repurposing

    Take the SRT or WebVTT output into an editor, or turn a talk into an article.

  • Research across channels

    Collect what a set of channels says about a topic and analyse it as text.

Pricing

Buy credits once. Use them whenever.

This endpoint costs 1 credit per request, and a request that returns no data costs nothing. Move the slider to see what your volume costs.

5,000requests a month
5005,00050,000250,000
5,000video transcripts
5,000searches or video lookups
100,000comments

One credit is one request that returns data. Requests that return nothing are free.

Best fit
Builder pack
12,000 credits, one-time payment
$29once
  • $2.42 per 1,000 requests
  • About $12.08 a month at this pace
  • Lasts about 2.4 months at this pace
  • Credits never expire
Start with 100 free credits

See all packs and what a credit buys

FAQ

Questions and answers

Does it work for videos without captions?

No. The API returns the captions YouTube has for a video, uploaded or auto-generated. It does not run speech recognition. A video without captions answers 404 no_transcript and costs nothing.

Which languages can I get?

Any language the video has captions in. Pass lang to choose one; availableLanguages in the response lists what exists. Without lang you get the video's original language.

Why not use the official YouTube Data API for captions?

Its captions.download method only works for videos you own or manage, and it needs OAuth. It cannot fetch the captions of other people's public videos.

What does a transcript cost?

One request costs 1 credit. Credit packs start at $9 for 3,000 credits, never expire, and a request that returns no data is not charged. New accounts get 100 free credits without a card.

How fast is it?

Most requests answer in 3 to 8 seconds. Each request is fetched live from YouTube, not served from an old copy.

Guides

Step-by-step guides

More

More YouTube APIs

Make your first request in a minute

Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.