# YouTube Transcript Scraper & API: channels, playlists, captions (`pikoulas/youtube-transcripts`) Actor

Get the transcript (captions or subtitles) of any YouTube video as clean text or timestamped segments, from video URLs, whole channels, playlists or search. Any language, auto-generated or manual, plus title, channel, views, likes and date. No API key, $1 per 1,000.

- **URL**: https://apify.com/pikoulas/youtube-transcripts.md
- **Developed by:** [Spyridon Pikoulas](https://apify.com/pikoulas) (community)
- **Categories:** Videos, AI, Social media
- **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.

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 & API

Get the transcript (captions or subtitles) of any YouTube video as clean text, or as timestamped segments, from four kinds
of source:

- **Videos:** any link form works: watch, youtu.be, Shorts, embed or live.
- **Channels:** the latest uploads of a whole channel, given as a URL, `@handle` or channel ID.
- **Playlists.**
- **Search:** videos from YouTube search results.

Every result also carries the video's title, channel, publish date, duration, views, likes,
category, keywords, description, and the list of caption languages the video has.

It needs no browser and no API key, and it is fast: 26 videos from four sources took 4 seconds.
It costs **$1 per 1,000 transcripts**, and videos without captions are free.

### What people use it for

- **AI and LLM pipelines:** summaries, RAG over a channel's back catalogue, training data.
- **Content repurposing:** turn videos into blog posts, newsletters or social posts.
- **Research:** what competitors, creators or experts say, searchable as text.
- **SEO and marketing:** mine the keywords and questions that come up in a niche.

### How to scrape YouTube transcripts

1. Click **Try for free**; Apify's free plan covers a first run.
2. Fill in any of **Videos**, **Channels**, **Playlists** and **Search queries**, and set
   **Max videos per channel, playlist or search**.
3. Click **Start**, then download the results as JSON, CSV, Excel or HTML, or read them through
   the API.

**Preferred languages** decides which captions you get, in order of preference. Manual captions
beat auto-generated ones in the same language. If none of your languages exists, you get the
video's own captions, and `availableLanguages` lists what the video has.

Turn on **Include timestamps** for `segments`: each line with its start time and duration.

```json
{
  "channels": ["@mkbhd"],
  "searchQueries": ["how to bake sourdough"],
  "maxVideosPerSource": 100,
  "languages": ["en", "es"],
  "includeTimestamps": true
}
```

### Output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "publishedAt": "2009-10-24T23:57:33-07:00",
  "durationSeconds": 213,
  "views": 1820137282,
  "likes": 19421546,
  "category": "Music",
  "availableLanguages": [
    {"code": "en", "name": "English", "autoGenerated": false},
    {"code": "en", "name": "English (auto-generated)", "autoGenerated": true},
    {"code": "de-DE", "name": "German (Germany)", "autoGenerated": false}
  ],
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "text": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ …",
  "segments": [{"start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪"}]
}
```

A video with no captions comes back with its details and an `error` field, and costs nothing.

### Use it as an API

One call runs it and returns the results as JSON (for runs under 5 minutes; longer ones start a
run and read its dataset). Apify's Python and JavaScript clients, and its Make, Zapier and n8n
integrations, work the same way.

```bash
curl -X POST "https://api.apify.com/v2/acts/pikoulas~youtube-transcripts/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "searchQueries": ["how to bake sourdough"], "maxVideosPerSource": 3}'
```

AI agents can call it as a tool through Apify's MCP server: `https://mcp.apify.com?tools=pikoulas/youtube-transcripts`.

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

You pay **$0.001 per transcript**, which is $1 per 1,000. Videos without captions are free. Runs
that go through Apify's residential proxy also pay its traffic, $0.0012 per 100 KB. There are no
monthly fees.

### Good to know

- YouTube sometimes blocks datacenter IPs. When that happens, the actor switches to Apify
  residential proxy by itself and retries, and you don't need to set anything up. A transcript
  takes about 16 KB of its traffic, so about $0.0002 on top.
- Transcripts are the captions YouTube has, either written by the creator or auto-generated. The
  actor does not do speech-to-text on videos that have no captions.
- Channels give their newest uploads first, Shorts and live streams included.

### FAQ

#### Is it legal to scrape YouTube?

It collects only what YouTube shows publicly, without logging in. Scraping public data is
generally legal, but personal data is protected by laws such as the GDPR and the CCPA, and
YouTube's terms may limit how you use what you collect. If you're unsure, ask a lawyer;
Apify's [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/) is a good start.

#### Something missing or not working?

Open an issue on the **Issues** tab with the input you used, or ask there for a field you need.

# Actor input Schema

## `videos` (type: `array`):

Video URLs or IDs: watch, youtu.be, Shorts, embed and live links all work.

## `channels` (type: `array`):

Channel URLs, @handles or channel IDs. Takes the channel's latest uploads.

## `playlists` (type: `array`):

Playlist URLs or IDs.

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

Videos from YouTube search, in YouTube's order.

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

Newest first for channels.

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

Language codes in order of preference: en, es, de... Manual captions win over auto-generated ones in the same language. If none exists, the video's own captions are returned.

## `includeTimestamps` (type: `boolean`):

Adds the transcript as segments with start time and duration, next to the plain text.

## `maxConcurrency` (type: `integer`):

How many videos are fetched at the same time.

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

Not needed to start. If YouTube blocks the run, the actor switches to Apify residential proxy by itself.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideosPerSource": 50,
  "languages": [
    "en"
  ],
  "includeTimestamps": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pikoulas/youtube-transcripts").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 = { "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("pikoulas/youtube-transcripts").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call pikoulas/youtube-transcripts --silent --output-dataset

```

## MCP server setup

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

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/S6eODdgHDMJhAIxeh/builds/Yz8o3jnPo2Yy9meSI/openapi.json
