# YouTube Transcript Scraper (`aurenic/youtube-transcript-scraper`) Actor

Extract transcripts from any YouTube video with the InnerTube ANDROID client — bypasses YouTube's PoToken wall. Text, SRT, VTT outputs plus video metadata.

- **URL**: https://apify.com/aurenic/youtube-transcript-scraper.md
- **Developed by:** [Aurenic](https://apify.com/aurenic) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

Extract transcripts from any YouTube video via the InnerTube ANDROID client — bypasses YouTube's PoToken wall that broke every web-based transcript scraper in 2026. Plain text, timestamped segments, SRT, VTT, plus full video metadata.

### What does YouTube Transcript Scraper do?

Pass video IDs or URLs, get clean transcripts with timestamps in one call. Every record includes:

- **Plain transcript text** — full video narration as a single string, ready for summarization or RAG ingestion
- **Timestamped segments** — array of `{ start, duration, text }` for precise navigation
- **SRT and VTT** output — subtitles-ready formats, selectable per run
- **Video metadata** — title, author, channel ID, view count, publish date, category, keywords, thumbnail

**Why this works when other scrapers fail.** Since April 2026, YouTube gates its caption endpoint (`/api/timedtext`) behind a **PoToken** — a proof-of-origin token minted by the player's JavaScript. Requests without it return **HTTP 200 with an empty body** — the worst possible failure mode, because the scraper silently returns nothing. Most libraries broke.

This actor sidesteps the wall entirely. It talks to YouTube's **InnerTube ANDROID client** (`/youtubei/v1/player` with `clientName: ANDROID`) — the same endpoint the Android app uses. **YouTube does not enforce PoToken on ANDROID client requests.** It's the same approach `yt-dlp` uses. Runs are backed by residential proxy by default, because YouTube blocks datacenter IPs for caption fetches.

### Output fields

| Field | Description |
|---|---|
| videoId | YouTube video ID |
| videoUrl | Canonical watch URL |
| title | Video title |
| author | Channel display name |
| channelId | Channel ID |
| lengthSeconds | Video duration in seconds |
| viewCount | Cumulative views |
| publishDate | ISO 8601 publication date |
| category | YouTube category |
| keywords | Video keywords array |
| thumbnailUrl | Highest-resolution thumbnail |
| language | Language code of the transcript |
| languageName | Human-readable language name |
| isAutoGenerated | `true` if ASR auto-captions, `false` if manual |
| isTranslatable | Whether the track supports translation |
| transcript | Plain-text transcript |
| segments | Array of `{ start, duration, text }` |
| srt | SRT-formatted subtitles (when `outputFormat` is `srt` or `all`) |
| vtt | WebVTT-formatted subtitles (when `outputFormat` is `vtt` or `all`) |
| error | Diagnostic message when a transcript could not be extracted |

### Who is it for?

- **LLM and RAG builders** ingesting video content into vector databases
- **Content analysts** extracting keyword and topic patterns from channel archives
- **Podcast and video producers** generating subtitles for repurposing
- **Market researchers** building searchable transcripts across competitor channels
- **Academic researchers** studying discourse across thousands of videos
- **Translation teams** pairing transcripts across languages

### Pricing

**$1.20 per 1,000 results.** No subscription.

| Results | Cost |
|---|---|
| 100 | $0.12 |
| 1,000 | $1.20 |
| 10,000 | $12.00 |

### How to use it

1. Paste **Video IDs** and/or **Video URLs**.
2. Set **Preferred Languages** (first match wins).
3. Toggle **Include Auto-Generated Captions** if manual captions aren't available.
4. Pick **Output Format** — plain text, SRT, VTT, or all three.
5. Click **Start**.

### Output example

```json
{
  "recordType": "transcript",
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "author": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "lengthSeconds": 213,
  "viewCount": 1600000000,
  "publishDate": "2009-10-25T00:00:00-07:00",
  "category": "Music",
  "keywords": ["Rick Astley", "Never Gonna Give You Up", "80s"],
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "isTranslatable": true,
  "transcript": "We're no strangers to love. You know the rules and so do I...",
  "segments": [
    { "start": 0.24, "duration": 3.36, "text": "We're no strangers to love" },
    { "start": 3.6, "duration": 3.6, "text": "You know the rules and so do I" }
  ],
  "srt": "1\n00:00:00,240 --> 00:00:03,600\nWe're no strangers to love\n\n2\n...",
  "vtt": "WEBVTT\n\n1\n00:00:00.240 --> 00:00:03.600\n...",
  "error": "",
  "scrapedAt": "2026-09-21T12:00:00.000Z"
}
```

### Technical details

- **No API key, no OAuth, no browser.** Uses YouTube's public InnerTube endpoints with the ANDROID client context.
- **PoToken bypass.** The ANDROID client is not subject to PoToken enforcement — this is the core reason the actor works when web-based scrapers return empty bodies.
- **Residential proxy by default.** YouTube returns "Sign in to confirm you're not a bot" to datacenter IPs for caption fetches. Residential proxy is pre-configured. Disable for one-off tests.
- **Caption format negotiation.** Requests `fmt=json3` (structured JSON) first, falls back to `fmt=srv3` (XML) if JSON isn't available.
- **Language matching.** Manual tracks are preferred over auto-generated tracks. Multiple languages can be ranked by preference.
- **Fallback path.** When the player endpoint returns no caption tracks, the actor tries the `get_transcript` continuation endpoint via InnerTube `next`.

### Known limits

- **Residential proxy recommended for all but the smallest runs.** One-off 5-video tests work on datacenter IPs; anything larger gets rate-limited.
- **Some videos have no captions at all.** Live streams, some music, and videos the creator disabled captions for return `error: "no captions available"`. These records are still emitted so you have a complete audit trail.
- **Auto-generated captions can be imperfect.** ASR produces run-on sentences with no punctuation. Manual captions are cleaner when available.
- **Translation is not included.** The actor returns the track in its native language. If a track is `isTranslatable`, you can request a translated track via the same InnerTube path — not exposed in this version.
- **YouTube changes the API periodically.** The InnerTube contract has been stable since 2019. If YouTube updates the client version, patch the `ANDROID_CLIENT.clientVersion` constant and rebuild.

### FAQ

**Do I need a YouTube Data API key?** No. The Data API doesn't return transcripts anyway — it only returns caption metadata. This actor fetches the actual caption content.

**Why do I need a residential proxy?** YouTube blocks datacenter IPs from caption endpoints with "Sign in to confirm you're not a bot." Residential proxy is the standard workaround. It's pre-configured; leave it on.

**Why did the transcript come back empty?** Either the video has no captions, the creator disabled them, or a track in your preferred language doesn't exist. The `error` field tells you which. Records with empty transcripts still include full metadata.

**Can I extract a playlist's transcripts?** Yes — resolve the playlist to video IDs first (using a playlist scraper) and pass those IDs as `videoIds`. Native playlist support is on the roadmap.

**How do I get translated captions?** Not exposed in this version. The actor returns the native-language track. Translated tracks use a different caption URL parameter — plan to add via the `tlang` parameter in a future release.

**How do I export data?** After a run, go to Storage → Export as JSON, CSV, Excel.

### Support

Open an issue on the Actor's page for bugs or feature requests.

# Actor input Schema

## `videoIds` (type: `array`):

Bare YouTube video IDs (e.g. dQw4w9WgXcQ).

## `videoUrls` (type: `array`):

Any YouTube URL form (youtube.com/watch?v=, youtu.be/, shorts/, embed/).

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

Language codes in priority order (e.g. en, es, de). The first matching manual track wins; auto-generated tracks are used only if no manual track matches.

## `includeAutoGenerated` (type: `boolean`):

Fall back to YouTube's ASR (auto-generated) track when no manual caption exists.

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

Attach title, author, channel ID, view count, publish date, category, and keywords to each transcript record.

## `outputFormat` (type: `string`):

Which transcript format to emit alongside the plain transcript. The raw `segments` array (with timestamps) is always included.

## `maxVideos` (type: `integer`):

Hard cap on videos per run.

## `useResidentialProxy` (type: `boolean`):

YouTube blocks datacenter IPs for caption fetches ('Sign in to confirm you're not a bot'). Keep this on unless you're running a very small test.

## Actor input object example

```json
{
  "videoIds": [
    "dQw4w9WgXcQ"
  ],
  "videoUrls": [],
  "languages": [
    "en"
  ],
  "includeAutoGenerated": true,
  "includeMetadata": true,
  "outputFormat": "text",
  "maxVideos": 100,
  "useResidentialProxy": true
}
```

# Actor output Schema

## `results` (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 = {
    "videoIds": [
        "dQw4w9WgXcQ"
    ],
    "videoUrls": [],
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aurenic/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 = {
    "videoIds": ["dQw4w9WgXcQ"],
    "videoUrls": [],
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("aurenic/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 '{
  "videoIds": [
    "dQw4w9WgXcQ"
  ],
  "videoUrls": [],
  "languages": [
    "en"
  ]
}' |
apify call aurenic/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aurenic/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/Q0D8jiUfqGSxhtXGD/builds/yK1lJKivobEM1aofw/openapi.json
