ScraperCompany · APIs · Pricing · Docs · llms.txt · Get an API key

YouTube scraper API YouTube

YouTube scraper API for transcripts, comments, videos and channels

Get a public video’s transcript as timed segments, its comments, its metadata and chapters, plus search results and channel pages. Structured JSON from one key, with no Google Cloud project and no Data API quota.

$4.00 per 1,000 calls with a credit pack, down to $1.20 on the Scale plan 500 free calls, no card. Failed calls are free. Then $20 for 10,000 credits, or plans from $39 a month. Free calls cover endpoints up to 30 credits a call.Checked Every API on one key
POST /v1/youtube/transcript 2 credits
{
  "search_parameters": {
    "engine": "youtube_transcripts",
    "video_id": "8jPQjjsBbIc",
    "hl": "en",
    "gl": "US"
  },
  "video": {
    "video_id": "8jPQjjsBbIc",
    "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
    "channel_id": "UCAuUUnT6oDeKwE6v1NGQxug",
    "author": "TED",
    "length_seconds": 740
  },
  "language": {
  …

YouTube transcripts feed AI and RAG pipelines, summaries, search indexes and content research. Comments, counts and channel pages feed creator analytics and brand monitoring. Google’s official YouTube Data API needs a Google Cloud project, counts every call against a daily quota, and only downloads caption tracks for videos you have permission to edit, so it cannot return the transcript of someone else’s video. This API reads public YouTube pages instead.

Ask for a transcript and you get every caption language the video has, each marked as creator-made or auto-generated, and one track as timed segments plus the joined text. Creator captions are chosen over auto-generated ones when both exist. YouTube rounds most numbers it shows (“1.7M views”), so counts are integers only where YouTube printed them exactly, and the text is always kept. Search answers are split into videos, Shorts, channels and playlists, with YouTube’s own filters for type, upload date, length and features.

What you get

segments[]
the transcript as timed lines: start_s, duration_s and text
text
the whole transcript joined into one string, ready for search or an LLM
available_languages[]
every caption track the video has: language, name, and manual or auto-generated (asr)
views, likes, length_seconds
exact view and like counts and the video length (video endpoint)
chapters[]
chapter titles and start times, and whether the creator or YouTube made them
comments[]
text, author, likes, reply count, and pinned and creator-heart flags
videos[], shorts[], channels[], playlists[]
search results, split by kind
subscribers_text, video_count_text
a channel’s counts as YouTube prints them, with its latest videos

One call, structured JSON

POST /v1/youtube/transcript, 2 credits per successful call.

curl -X POST "https://api.scrapercompany.com/v1/youtube/transcript" \
  -H "x-api-key: $SCRAPERCOMPANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "video_id": "8jPQjjsBbIc"
  }'
Response (trimmed)
{
  "search_parameters": {
    "engine": "youtube_transcripts",
    "video_id": "8jPQjjsBbIc",
    "hl": "en",
    "gl": "US"
  },
  "video": {
    "video_id": "8jPQjjsBbIc",
    "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
    "channel_id": "UCAuUUnT6oDeKwE6v1NGQxug",
    "author": "TED",
    "length_seconds": 740
  },
  "language": {
    "code": "en",
    "name": "English",
    "kind": "manual",
    "translatable": true,
    "is_default": true
  },
  "available_languages": [
    {
      "code": "ar",
      "name": "Arabic",
      "kind": "manual",
      "translatable": true,
      "is_default": false
    },
    {
      "code": "en",
      "name": "English",
      "kind": "manual",
      "translatable": true,
      "is_default": true
    }
  ],
  "segments": [
    {
      "start_s": 13.24,
      "duration_s": 2.56,
      "text": "A few years ago, I broke into my own house."
    },
    {
      "start_s": 16.88,
      "duration_s": 1.216,
      "text": "I had just driven home,"
    }
  ],
  "text": "A few years ago, I broke into my own house. I had just driven home, it was around midnight in the dead of Montreal winter,",
  "meta": {
    "source": "youtube",
    "client": "IOS",
    "elapsed_s": 0.44
  }
}

Every field, documented before you buy

What one POST /v1/youtube/transcript call returns: 25 fields with their type and a value from the example above, then every input the call takes.

In the response

FieldTypeExampleWhat it is
videoobject
video.video_idstring"8jPQjjsBbIc"
video.titlestring"How to stay calm when you know you'll b…"Title as the site shows it.
video.channel_idstring"UCAuUUnT6oDeKwE6v1NGQxug"
video.authorstring"TED"Author as the site names them.
video.length_secondsinteger740
languageobjectLanguage code.
language.codestring"en"
language.namestring"English"Name as the site shows it.
language.kindstring"manual"
language.translatablebooleantrue
language.is_defaultbooleantrue

Arrays show their first item; every item has the same fields. Full schema in the API reference

In the request

InputTypeRequiredWhat it does
video_idstringRequiredThe 11-character video id (8jPQjjsBbIc) or any YouTube video URL: watch?v=, youtu.be/, /shorts/, /embed/, /live/.Min length 11, max length 300.
langstring | nullOptionalCaption language code (en, pt-BR).Min length 2, max length 20, pattern ^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$.
hlstringOptionalInterface language YouTube localizes texts in (hl): relative dates, view-count wording, caption track names.Default en. Pattern ^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,4})?$.
glstringOptionalContent country (gl), two letters.Default US. Pattern ^[A-Za-z]{2}$.

Endpoints and price per call

Credits per successful call, and what 1,000 calls cost: from a credit pack down to the Scale plan. Failed requests cost nothing.

EndpointWhat it returnsCreditsPer 1,000 calls
Transcript
POST /v1/youtube/transcript
One caption track as timed segments and full text, with every language the video has2 credits$4.00 – $1.20
Search
POST /v1/youtube/search
One page of results split into videos, Shorts, channels and playlists, with YouTube’s filters2 credits$4.00 – $1.20
Video details
POST /v1/youtube/video
Title, full description, exact views and likes, dates, keywords and chapters2 credits$4.00 – $1.20
Comments
POST /v1/youtube/comments
One page of about 20 comment threads, top or newest, and their replies2 credits$4.00 – $1.20
Channel
POST /v1/youtube/channel
A channel’s details and its latest videos, about 30 per page2 credits$4.00 – $1.20

See all plans

Your first call in three steps

  1. 01

    Get an API key

    Create an account and verify your email, then copy a key from the dashboard. The free trial is 500 free calls, once, no card needed.

  2. 02

    Send POST /v1/youtube/transcript

    Put the key in the x-api-key header and pass video_id. Every other input is optional and listed above.

  3. 03

    Read the JSON

    The answer is one JSON object with video, language, available_languages, segments and text, typed and named the same way on every call. A failed call costs 0 credits, so retrying is free.

Limits and coverage

Where it works
Worldwide
  • Empty answers and unknown or private videos are free.

Is it legal to scrape YouTube?

It depends on what you collect and what you do with it. Here is what the API does, and what stays with you once the data is yours.

Public pages only

The API reads what YouTube shows anyone who opens the page without signing in. It uses no account and opens nothing behind a paywall.

Facts are not the same as content

A price on a date, a rating or a count is a fact, and copyright does not protect facts. Review text, photos, descriptions and transcripts belong to their authors or the site. Counting, scoring or summarising them is a different use from republishing them, and republishing usually needs permission.

Databases have their own right in the EU and UK

Whoever invested in building a database there can stop others taking a substantial part of it, and repeated extraction of small parts can add up to a substantial part. Collect the fields and dates you need, not a copy of YouTube.

Personal data is yours to handle

Videos, comments and transcripts carry creators’ and commenters’ names and handles. If you keep it, the GDPR and UK GDPR apply to people in Europe and the UK, and other places have their own privacy laws: you need a lawful basis, must tell people you hold their data unless an exemption applies, should collect no more than you need, and should delete it on a schedule. The simplest route is not to keep it: drop names and handles before you store anything. A hashed name is still personal data.

The site’s terms, and ours

The terms of use of YouTube may limit automated access to it or reuse of its data. Our Terms make you responsible for how you use the data you collect, for following the terms of the sites it comes from, for data protection law, and for having the rights you need.

This is general information, not legal advice. For a specific use, ask a lawyer where you operate. YouTube is a trademark of its owner. ScraperCompany is independent: not affiliated with or endorsed by YouTube, and this is not an official YouTube API.

Frequently asked questions

Read next

Guides

Does YouTube have an official API?

Yes. The YouTube Data API v3 is Google’s official API. It needs a Google Cloud project, counts every request against a daily quota, and its caption download method only works for videos you have permission to edit, so it does not return transcripts of other channels’ videos. This API is independent of YouTube and Google: it reads public YouTube pages and uses no Data API quota.

Can this YouTube transcript API get any video’s transcript?

Any public video that has captions, whether the creator uploaded them or YouTube generated them automatically. Pass the video id or URL, and optionally a lang code; available_languages lists every track and whether it is manual or auto-generated (asr). A video without captions, or without a track in the language you ask for, returns a 404 and is not charged. Age-restricted videos have no transcript through this API.

Can the API translate a transcript?

No. It returns the caption tracks a video actually has, in their own languages, and does not request YouTube’s machine translations. Pick a track with lang from the codes in available_languages.

Why are some counts null?

YouTube rounds most counts on search results, channel grids and comments (“1.7M views”, “14K”). The API returns an integer only when YouTube printed the exact number, and always keeps the text in fields such as views_text and likes_text. The video endpoint returns exact views and likes.

How do I page through search results, comments and channel videos?

Each response includes next_page_token; send it back to get the next page. A comment’s replies_page_token returns its replies through the same comments endpoint. An empty page is not charged.

Do failed requests cost credits?

No. A failed or blocked call (any 4xx or 5xx response) costs 0 credits, and so does a search page that comes back empty. You pay only for successful results.

How do I get an API key?

Create an account on the sign-up page and verify your email. You get a free trial of 500 free calls, once, no card needed; for everything else, and after the trial, buy a credit pack (from $20) or pick a plan. You create and rotate keys yourself in the dashboard.

More APIs on the same key

All APIs
TikTok API

Get a public video with its counts and media, a profile with exact follower and like counts, search results, a hashtag and its recent videos, or a video’s comments, as structured JSON.

Web scraping API

Send a URL, get the page back as HTML, markdown or text. If an attempt does not return the page, the request is tried again automatically, and you pay only for a page that comes back with content.

Screenshot API

Send a URL, get back an image of the page as a visitor sees it, after its JavaScript has run and its images have loaded. Pick the size, the format and what to capture: the viewport, the whole page or one element.

FAA Aircraft Registry API

Look up any US tail number and get the FAA’s public record as JSON, or search the whole registry by owner, manufacturer, model, place or year: owner, airframe, engine and certificate dates, plus recent document receipts.

Start with 500 free calls

Create an account and verify your email: your own API keys and 500 free calls, once, no card needed. When you need more, pay $20 as you go or pick a plan from $39 a month.

No card needed. Then $20 for 10,000 credits, or plans from $39 a month.