# YouTube Transcript Scraper — Subtitles, Timestamps & LLM Text (`valev-lab/youtube-transcript-scraper`) Actor

Bulk YouTube transcript extractor and API. Paste videos, Shorts, playlists or channels, or search YouTube. Get text with timestamps, SRT, VTT and LLM-ready chunks, plus chapters, likes and metadata. Any caption language. No API key, no IP blocks. Videos without captions are free.

- **URL**: https://apify.com/valev-lab/youtube-transcript-scraper.md
- **Developed by:** [Daniel Valev](https://apify.com/valev-lab) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 transcripts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Transcript Scraper — Captions, Subtitles & LLM-Ready Text, No API Key

### What does YouTube Transcript Scraper do?

**YouTube Transcript Scraper is a bulk YouTube transcript extractor and API.** It gets the transcript of any YouTube video that has captions, the creator's own or YouTube's auto-generated ones, and returns it as clean data: **plain text**, **timestamped segments**, **SRT** and **WebVTT** subtitle files, and **LLM-ready chunks** with start and end times. Every row also has the video's **title, channel, publish date, views, likes, description, tags, thumbnail, and chapters**.

Paste **videos, Shorts, playlists, or channels**, or **search YouTube**, and get one row per video. Pick the caption languages you want, manual or auto-generated captions, and optionally ask YouTube to translate them.

**No API key, no login, no AI transcription.** The text is YouTube's own captions, so it is fast and cheap. **Videos without captions, failed videos, and duplicates are never charged.**

#### At a glance

| | |
| --- | --- |
| **Input** | Video and Shorts URLs, video IDs, playlists, channels (`/@handle`, `/channel/UC…`, `/videos` tab), YouTube search |
| **Per video** | Transcript text, segments, SRT, VTT, LLM chunks, language, auto-generated flag, available languages, chapters, metadata |
| **Captions** | Manual and auto-generated, in any language YouTube has; your language order; optional YouTube auto-translate |
| **Channels** | Newest videos first, with a published-from / published-until date filter |
| **Speed** | About 1 second per video, 5 videos at a time |
| **Reliability** | 20 of 20 test runs on Apify succeeded; every video answered (November 2026) |
| **Price** | From $1.00 per 1,000 transcripts; videos without captions are free |
| **Login or API key** | Not needed |

### Why use this YouTube transcript scraper?

- 🤖 **AI, RAG, and agents:** feed transcripts to ChatGPT, Claude, or your own model. The **llm** format splits each transcript into chunks of the size you choose, each with its start and end time, so answers can link back to the exact moment in the video. Chapters give you natural section breaks.
- ♻️ **Content repurposing:** turn videos into blog posts, newsletters, show notes, social posts, and quotes. Download **SRT** or **VTT** to re-upload subtitles or edit them in a video editor.
- 🔬 **Research and analysis:** collect every video of a channel or a search topic, with publish dates, views, and likes, and analyze what is said: topic modeling, sentiment, brand mentions, competitor research, lecture notes, or academic studies.
- 🌍 **Multilingual work:** take captions in the language you need, fall back to the original language, or ask YouTube to translate.
- 🔎 **SEO:** find the words creators in your niche actually use, and check what a video covers before you link to it.

Running on Apify also gives you scheduling, monitoring, API access, webhooks, and integrations with Make, Zapier, n8n, Google Sheets, and more.

### Ways to get YouTube transcripts, compared

| | YouTube "Show transcript" button | YouTube Data API | `youtube-transcript-api` (Python) | Browser extensions | This Actor |
| --- | --- | --- | --- | --- | --- |
| Other people's videos | Yes | No, only your own channel's captions | Yes | Yes | Yes |
| Many videos at once | One at a time, copy and paste | — | Yes, in your code | Usually one at a time | Channels, playlists, searches, up to 1,000 per source |
| Works from servers and the cloud | — | Yes | Often blocked: "IP blocked" and rate-limit errors | No | Yes, proxies and retries built in |
| Timestamps, SRT, VTT | Timestamps, copy only | Caption files | Timestamps | Varies | Text, segments, SRT, VTT, LLM chunks |
| Title, date, views, likes, chapters | — | Separate calls, quota | No | Varies | Included in every row |
| Cost | Free, manual | Free with quota | Free, plus your proxies | Free or subscription | From $1.00 per 1,000 transcripts |

### What data does it extract?

| Transcript | Video | Captions |
| --- | --- | --- |
| `transcriptText`: the whole transcript | `title`, `url`, `videoId` | `language` of the transcript |
| `segments`: start, duration, text | `channelName`, `channelId`, `channelUrl` | `isAutoGenerated`: YouTube speech recognition or creator-uploaded |
| `srt` and `vtt` subtitle files | `publishedAt`, `durationSec` | `isTranslated`, `translatedFrom` |
| `llmChunks`: start, end, text | `viewCount`, `likeCount` | `availableLanguages`: every caption track |
| `wordCount` | `description`, `tags`, `thumbnail` | `error` and `errorCode` when there is no transcript |
| | `chapters`: title and start | `warnings` for anything requested but missing |

### How to get a YouTube transcript

1. Click **Try for free**.
2. Paste one or more **video, Short, playlist, or channel URLs**, or type a **search** term.
3. Set **Preferred languages** (for example `en`) and pick the **Output formats** you want.
4. Click **Start** and download the results as JSON, CSV, Excel, or text.

### How much does it cost to scrape YouTube transcripts?

You pay per transcript delivered. Apify platform usage is included in the price.

| Event | Free plan | Bronze | Silver | Gold and above |
| --- | ---: | ---: | ---: | ---: |
| 1 transcript | $0.0015 | $0.00135 | $0.0012 | $0.001 |
| 1,000 transcripts | $1.50 | $1.35 | $1.20 | $1.00 |

**Not charged:** videos without captions, private, age-restricted, removed, or live videos, videos YouTube did not answer for, duplicates, and rows with a warning (for example a refused translation). Those rows are still saved, free, with the reason. Metadata and chapters are included at no extra cost. Each run also has a start fee of $0.00005. Set a **maximum total charge** on the run and the Actor stops there.

#### Compared with other YouTube transcript Actors

Prices for one video with a transcript, from the Apify Store on 7 November 2026. Run success is each Actor's share of successful runs over the past 30 days, as shown on its Store page.

| Actor | Price per 1,000 (Free → best tier) | Metadata | Runs succeeded (30 days) |
| --- | --- | --- | --- |
| **This Actor** | **$1.50 → $1.00** | **Included, with likes and chapters** | New |
| `pintostudio/youtube-transcript-scraper` | $10.00 | — | 89.3% |
| `starvibe/youtube-video-transcript` | $5.00 | — | 99.9% |
| `johnvc/YoutubeTranscripts` | $2.75 → $2.00 | $3.00 per 1,000 extra | 99.9% |

### Input example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/shorts/rL0qEmTRI-I",
    "https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab",
    "https://www.youtube.com/@3blue1brown/videos"
  ],
  "searchQueries": ["retrieval augmented generation tutorial"],
  "maxVideosPerSource": 10,
  "languages": ["en"],
  "useAnyAvailableLanguage": true,
  "captionType": "both",
  "outputFormats": ["text", "segments", "llm"],
  "chunkSize": 2000,
  "includeMetadata": true,
  "includeChapters": true
}
```

- **Videos, Shorts, playlists, or channels:** video and Short URLs (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`), plain 11-character video IDs, playlist URLs, and channel URLs (`/@handle`, `/channel/UC…`, `/c/…`, or their `/videos` tab).
- **Search YouTube:** each search term gives its top videos.
- **Max videos per playlist, channel, or search:** default 20, up to 1,000.
- **Channel videos published from / until:** dates (YYYY-MM-DD) to limit channels to a period. Videos outside it are skipped for free.
- **Preferred languages:** in order of preference. `en` also matches `en-US` and `en-GB`.
- **Fall back to any available language:** on by default. Off, a video without your languages comes back with `NO_CAPTIONS`, free.
- **Caption type:** `both` (manual first), `manual`, or `auto`.
- **Translate to:** a language code. A video with captions in that language uses them; otherwise YouTube's auto-translate is asked for (see the FAQ).
- **Output formats:** `text`, `segments`, `srt`, `vtt`, `llm`. Formats you do not pick are `null` in the row.
- **LLM chunk size:** the longest chunk in characters, default 2,000 (about 400–500 English tokens).

### Output example

One row per video. Lists and long texts are shortened here.

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channelName": "jawed",
  "channelId": "UC4QobU6STFB0P71PMvOGN5A",
  "channelUrl": "https://www.youtube.com/@jawed",
  "publishedAt": "2005-04-24T03:31:52.000Z",
  "durationSec": 19,
  "viewCount": 447949502,
  "likeCount": 20130018,
  "description": "…",
  "tags": ["me at the zoo", "jawed karim", "first youtube video"],
  "thumbnail": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg?…",
  "language": "en",
  "isAutoGenerated": false,
  "isTranslated": false,
  "translatedFrom": null,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false },
    { "code": "de", "name": "German", "isAutoGenerated": false }
  ],
  "transcriptText": "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 cool …",
  "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..." }
  ],
  "srt": "1\n00:00:01,200 --> 00:00:03,360\nAll right, so here we are, in front of the elephants\n…",
  "vtt": "WEBVTT\n\n00:00:01.200 --> 00:00:03.360\nAll right, so here we are, in front of the elephants\n…",
  "llmChunks": [
    { "start": 1.2, "end": 18.881, "text": "All right, so here we are, in front of the elephants the cool thing about these guys …" }
  ],
  "chapters": [
    { "title": "Intro", "start": 0 },
    { "title": "The cool thing", "start": 5 },
    { "title": "End", "start": 17 }
  ],
  "wordCount": 39,
  "warnings": [],
  "error": null,
  "errorCode": null,
  "scrapedAt": "2026-11-07T15:50:45.225Z"
}
```

A video without a transcript has `transcriptText: null`, an `errorCode`, and an `error` saying why: `NO_CAPTIONS`, `PRIVATE` (also members-only), `AGE_RESTRICTED`, `UNAVAILABLE` (removed, missing, or blocked in a region), `LIVE` (live now or not started), or `FETCH_FAILED` (YouTube did not answer after every retry).

The dataset has two views:

- **Overview:** thumbnail, title, channel, date, duration, views, language, word count, and error per video.
- **Plain-text transcripts:** title, URL, language, and the whole transcript, ready to export as CSV or Excel.

Each run also saves a `RUN_SUMMARY` record with the outcome, request count, and data used for every video.

### Use the YouTube transcript API from code

Every run can be started through the [Apify API](https://docs.apify.com/api/v2), and results come back as JSON.

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("valev-lab/youtube-transcript-scraper").call(run_input={
    "startUrls": ["https://www.youtube.com/@3blue1brown/videos"],
    "maxVideosPerSource": 50,
    "outputFormats": ["llm"],
    "chunkSize": 1500,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    for chunk in row["llmChunks"] or []:
        print(row["url"], chunk["start"], chunk["text"][:80])
```

For plain text files, download `https://api.apify.com/v2/datasets/<DATASET_ID>/items?view=transcripts&format=csv`.

In JavaScript or TypeScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('valev-lab/youtube-transcript-scraper').call({
    startUrls: ['https://www.youtube.com/watch?v=aircAruvnKk'],
    outputFormats: ['text', 'srt'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].transcriptText);
```

In Make, Zapier, or n8n, use the Apify app's "Run Actor" action with the same input, then read the dataset items.

AI assistants can use it as a tool through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp): `https://mcp.apify.com?tools=valev-lab/youtube-transcript-scraper`.

### How reliable is it?

In 20 back-to-back test runs on Apify in November 2026 (single videos, Shorts, playlists, channels, and searches in several languages; 198 videos), **all 20 runs succeeded and YouTube answered for every video**: 187 transcripts, and 11 videos correctly reported as having no captions or being age-restricted. No video failed to download.

- **HTTP only, no browser.** A video with captions takes four small requests (about 7–20 KB in total), so runs are fast.
- **One bad video never fails the run.** It comes back as a row with an `errorCode`, free, and the other videos continue.
- **Automatic retries** with exponential backoff and jitter, and a new proxy IP and fresh cookies after a 429, a 403, or a "confirm you're not a bot" page.
- **Datacenter proxy first.** A request YouTube blocks is repeated through residential proxy, for that request only, so most of the run stays on fast datacenter IPs. You never pay for the proxy.
- **Two YouTube app clients.** When one does not return captions, the other is asked before a video is marked `NO_CAPTIONS`.
- **Input checked before anything is charged**, with a message that says what to fix.

### FAQ

#### Is there a YouTube transcript API?

Yes. This Actor works as a **YouTube transcript API**: send a list of video, playlist, or channel URLs over HTTP, from Python, JavaScript, Make, Zapier, or n8n, and get JSON back. YouTube's own Data API only downloads captions of videos on your own channel, so it cannot get transcripts of other people's videos.

#### `youtube-transcript-api` says my IP is blocked. What can I do?

The Python library `youtube-transcript-api` calls YouTube from your own server, and YouTube often blocks cloud and datacenter IPs with "IP blocked", "RequestBlocked", or rate-limit (429) errors. This Actor handles that for you: each request goes through Apify datacenter proxy, a blocked request is repeated through residential proxy, and YouTube's bot checks are detected and retried with a new IP. Call it from Python as shown in [Use the YouTube transcript API from code](#use-the-youtube-transcript-api-from-code); `segments` has the same `start`, `duration`, and `text` fields you are used to.

#### How do I download YouTube transcripts in bulk?

Paste a channel or playlist URL, or several, and set **Max videos per playlist, channel, or search** (up to 1,000 each). You can also paste a long list of video URLs or IDs. Export the dataset as JSON, CSV, or Excel, or use the **Plain-text transcripts** view to get one transcript per row.

#### How do I get a YouTube transcript with timestamps?

Pick `segments` in **Output formats** for each caption line with its `start` and `duration` in seconds, or `srt` / `vtt` for subtitle files with timecodes. `llmChunks` and `chapters` have start times too.

#### How do I use a YouTube transcript with ChatGPT or Claude?

Pick `text` for the whole transcript, or `llm` for chunks sized for a prompt or a vector database, and paste or send them to the model with your question. For many videos, run the Actor on a channel or playlist and load the rows into your RAG pipeline; each chunk has the video URL and start time, so answers can cite the exact moment. AI agents can also call the Actor directly through the Apify MCP server.

#### Can I get a transcript of a video without captions?

No. This Actor reads the captions YouTube already has, manual or auto-generated, which is why it is fast and cheap. YouTube auto-generates captions for most videos in common languages, so most videos have one. A video without any captions comes back with `NO_CAPTIONS`, free; for those you need a speech-to-text service that downloads the audio.

#### How do I translate a YouTube transcript to English?

Set **Translate to** to `en`. A video with English captions uses them directly. For other videos YouTube's auto-translate is requested, which YouTube allows only for a share of requests; when it refuses, you get the original language with a warning, free.

#### What happens to videos without captions?

They are skipped and **not charged**. You still get a row for each one, with `errorCode: "NO_CAPTIONS"` and the reason, so you know which videos had nothing to transcribe. The same applies to private, members-only, age-restricted, removed, and live videos. This Actor reads YouTube's captions only; it does not run speech recognition on the audio.

#### Do I need a YouTube API key or a Google account?

No. The Actor reads the same captions anyone can turn on in the YouTube player. The official YouTube Data API only lets channel owners download their own captions, so it cannot get transcripts of other people's videos.

#### What is the difference between manual and auto-generated captions?

Manual captions are written or uploaded by the creator and are usually accurate, with punctuation. Auto-generated captions come from YouTube's speech recognition: available for most videos in common languages, but with recognition mistakes and sometimes no punctuation. By default the Actor takes manual captions when they exist in your language and auto-generated ones otherwise; `isAutoGenerated` tells you which you got.

#### Which languages are supported?

Every language YouTube has captions in. Put your languages in order in **Preferred languages**. With **Fall back to any available language** on, a video without them still gives its transcript in its own language, original language first. `availableLanguages` lists every track the video has.

#### Can it translate transcripts?

Yes, with YouTube's own auto-translate, at no extra cost. Set **Translate to** (for example `de`). A video that already has captions in that language uses them. Otherwise YouTube is asked to translate. YouTube limits auto-translation much more strictly than captions: in our tests it translated about one video in four (4 of 18 through Apify Proxy). When it refuses, you get the transcript in the original language with a warning, and that row is **not charged**. After 3 refusals in a row, the run stops asking for translations so it does not slow down.

#### How do I get transcripts of a whole channel or playlist?

Paste the channel URL (for example `https://www.youtube.com/@3blue1brown`) or the playlist URL and set **Max videos per playlist, channel, or search**. Channels give their newest videos first, from the Videos tab. Use the date fields to get only videos from a period, for example the last month.

#### Does it work with YouTube Shorts?

Yes. Paste a Shorts URL (`youtube.com/shorts/…`) or its ID. Most Shorts have auto-generated captions.

#### Can I get SRT or VTT subtitle files?

Yes. Select `srt` or `vtt` in **Output formats** and each row has the whole file as text. Timings never overlap, so the files work in video editors and players.

#### What is the LLM format for?

For retrieval-augmented generation (RAG), summaries, and AI agents. Each transcript is split between caption lines into chunks of at most **LLM chunk size** characters, each with its `start` and `end` in seconds. Store the chunks in a vector database with the video URL and start time, and every answer can link to the exact moment, for example `https://www.youtube.com/watch?v=<videoId>&t=<start>s`.

#### Why is a video age-restricted or private in my results?

YouTube shows the captions of age-restricted videos only to signed-in adults, and private or members-only videos only to people with access. The Actor does not sign in to YouTube, so these videos come back with `AGE_RESTRICTED` or `PRIVATE`, free.

#### Is it legal to scrape YouTube transcripts?

The Actor reads public captions that YouTube shows to every visitor, without signing in. Transcripts can be protected by copyright, so check how you plan to use them, especially for republishing. If you are unsure, consult a lawyer.

# Actor input Schema

## `startUrls` (type: `array`):

One per line: a video or Short URL, a plain 11-character video ID, a playlist URL (youtube.com/playlist?list=…), or a channel URL (youtube.com/@handle, /channel/UC…, or its /videos tab). Playlists and channels give their newest videos first, up to the limit below.

## `searchQueries` (type: `array`):

Search terms. The top videos of each search are scraped, up to the limit below.

## `maxVideosPerSource` (type: `integer`):

How many videos to take from each playlist, channel, and search. Single videos always count as one.

## `dateFrom` (type: `string`):

Channels only: skip videos published before this date (YYYY-MM-DD, UTC). Skipped videos are not charged.

## `dateTo` (type: `string`):

Channels only: skip videos published after this date (YYYY-MM-DD, UTC, inclusive).

## `languages` (type: `array`):

Caption languages in order of preference, as codes such as en, de, pt-BR, or bg. en also matches en-US and en-GB.

## `useAnyAvailableLanguage` (type: `boolean`):

When none of your languages exists for a video, take its captions in the language it has (the original language first). Off: such videos come back with errorCode NO_CAPTIONS and are not charged.

## `captionType` (type: `string`):

Manual captions are uploaded by the creator; auto-generated ones come from YouTube's speech recognition. Both: manual is used when it exists in the chosen language.

## `translateTo` (type: `string`):

Optional language code. A video that has captions in this language uses them. Otherwise YouTube's own auto-translate is requested; when YouTube refuses it, you get the original language with a warning, and that row is not charged.

## `outputFormats` (type: `array`):

What each row includes. text: the whole transcript as plain text. segments: lines with start time and duration in seconds. srt and vtt: subtitle files as text. llm: plain-text chunks with start and end times, sized for AI and RAG.

## `chunkSize` (type: `integer`):

Longest chunk for the llm format, in characters. Chunks end between caption lines. 2,000 characters is about 400–500 tokens of English.

## `includeMetadata` (type: `boolean`):

Publish date, views, likes, description, tags, and thumbnail. Off: only the title, channel, and duration come with the transcript.

## `includeChapters` (type: `boolean`):

The video's chapters with their start times, from the description or YouTube's automatic chapters.

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy is used first. A request YouTube blocks is repeated through residential proxy, at no extra cost to you.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/@3blue1brown/videos"
  ],
  "maxVideosPerSource": 20,
  "languages": [
    "en"
  ],
  "useAnyAvailableLanguage": true,
  "captionType": "both",
  "outputFormats": [
    "text",
    "segments"
  ],
  "chunkSize": 2000,
  "includeMetadata": true,
  "includeChapters": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `transcripts` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "https://www.youtube.com/@3blue1brown/videos"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("valev-lab/youtube-transcript-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "https://www.youtube.com/@3blue1brown/videos",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("valev-lab/youtube-transcript-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/@3blue1brown/videos"
  ]
}' |
apify call valev-lab/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,valev-lab/youtube-transcript-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/TUdMn3ZAkCdXnze4r/builds/om4tpGT9YN7Sxwt9t/openapi.json
