# YouTube Transcript Scraper - Videos, Shorts & Captions (`headply/youtube-transcript-scraper`) Actor

Transcribe YouTube videos and Shorts. Uses the caption when present, on-device speech recognition when not, plus on-screen text OCR and a hook field. No login. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/headply/youtube-transcript-scraper.md
- **Developed by:** [Mayowa Ogedengbe](https://apify.com/headply) (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 $3.00 / 1,000 video 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

Get a clean **transcript** from any **YouTube** video or **Short**, plus the **on-screen text** burned into the frames that no caption file carries. Paste YouTube video, Shorts, channel or playlist URLs and get back the spoken words, the words shown on screen, and a hook field for the opening seconds. No login, no cookies, no API key.

The Actor reads the video's own caption when it has one, human or auto-generated, and falls back to on-device speech recognition when it does not, so it returns a transcript for videos that have no captions at all.

### What this Actor does

- Transcribes any **YouTube** video or **Short** from its URL.
- Uses the **caption track** when present (human or auto), and **speech recognition** when it is not.
- Reads the **on-screen text** with OCR, the titles and captions baked into the frames.
- Returns a **hook** field for the opening seconds.
- Gives timed **segments**, full text, language, author, views and duration.
- Expands a **channel or playlist URL** into its recent videos.
- Exports to JSON, CSV, Excel, or straight to the Apify API.

### How to get a YouTube transcript

1. Paste YouTube video, Shorts, channel or playlist URLs into **Video URLs**.
2. Set **Preferred language** or clear it to auto-detect.
3. Turn on **Read on-screen text** to also read the words shown in the frames.
4. Click **Start** and export the results.

### Where the transcript comes from

Each row records its source in `transcript.source`: **caption** for the video's own track, or **asr** for on-device speech recognition when there is no caption. On-screen text is returned separately, per frame and combined.

### How much does it cost?

Pay-per-event pricing, so you pay for the results you receive.

| Event | Price |
| --- | --- |
| Video transcript | $0.005 |
| On-screen text | $0.04 |

A transcript for **1,000 videos** costs about **$5**. Adding on-screen text costs about **$40** more per 1,000. Tier discounts lower both, and the Apify free plan includes credits to test it.

### Input example

```json
{
  "startUrls": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
  "includeOnScreenText": false
}
```

### Related scrapers

- **TikTok Transcript Scraper** for TikTok videos.
- **TikTok & YouTube Transcript Scraper** to transcribe both in one run.

### Frequently asked questions

#### Do I need to log in or supply an API key?

No. There is no login, cookie or API key. You only need an Apify account.

#### What if a video has no captions?

The Actor runs speech recognition on the audio and returns that transcript, marked `source: asr`.

#### Can I transcribe a whole channel?

Yes. Paste a channel or playlist URL and it expands into the recent videos, up to your max videos limit.

#### What formats can I export?

JSON, CSV, Excel, XML and RSS, plus the Apify API and integrations such as Google Sheets, Make and Zapier.

# Changelog

This Actor's version history is a separate document: https://apify.com/headply/youtube-transcript-scraper/changelog.md

# Actor input Schema

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

TikTok video URLs (tiktok.com/@user/video/...), YouTube video or Shorts URLs, or YouTube channel and playlist URLs (expanded to their recent videos).

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

Upper bound on how many videos to process, including videos expanded from a channel or playlist URL.

## `includeOnScreenText` (type: `boolean`):

Recognize the text burned into the video frames (captions, titles, callouts) with OCR. This is the field no caption track carries. It samples frames and costs more per video.

## `language` (type: `string`):

Two-letter language code for the transcript, for example <b>en</b>. Leave empty to auto-detect and use the video's own caption language.

## `hookSeconds` (type: `integer`):

How many opening seconds to pull into a separate hook field, which is what creative teams sort on.

## `ocrFrameInterval` (type: `integer`):

Seconds between sampled frames when reading on-screen text. Lower catches more text but costs more.

## `ocrMaxFrames` (type: `integer`):

Safety cap on frames read per video.

## `concurrency` (type: `integer`):

How many videos to fetch in parallel.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxVideos": 100,
  "includeOnScreenText": false,
  "language": "en",
  "hookSeconds": 5,
  "ocrFrameInterval": 3,
  "ocrMaxFrames": 24,
  "concurrency": 4
}
```

# Actor output Schema

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

One item per video with transcript and optional on-screen text.

# 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": [
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        }
    ],
    "maxVideos": 100,
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("headply/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": [{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }],
    "maxVideos": 100,
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("headply/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": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "maxVideos": 100,
  "language": "en"
}' |
apify call headply/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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