# Youtube Transcript Scraper. $1/1k results⚡ (`vistics/youtube-transcript-scraper-1-1k-results`) Actor

Extract transcripts from any YouTube video in seconds.
Supports auto-generated & manual captions, timestamps,
JSON & plain text output. Perfect for content creators,
researchers, SEO & NLP projects. 🎬

- **URL**: https://apify.com/vistics/youtube-transcript-scraper-1-1k-results.md
- **Developed by:** [Ilong Mamman](https://apify.com/vistics) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 214 total users, 38 monthly users, 100.0% runs succeeded, 35 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.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

### 📌 Introduction

The **YouTube Transcript Scraper** is a robust tool for extracting transcripts from YouTube videos. Whether you need auto-generated captions or user-uploaded subtitles, this scraper delivers accurate, structured transcript data for any video with available captions.

***

### 🎯 What Does This Tool Do?

- Extracts transcripts from YouTube videos using a full URL
- Supports both auto-generated and manually created captions.
- Outputs transcripts in both JSON and plain text formats for easy integration and analysis.

***

### 🚀 Key Features

- Retrieve transcripts from any YouTube video with captions
- Accepts only full URLs
- Outputs in JSON and plain text
- Includes timestamps for each transcript segment
- Fast and reliable extraction
- Json output for easy intrgration
- Minimal setup required

***

### 🔍 Use Cases

- **Content Creators:** Generate subtitles or repurpose video content.
- **Researchers:** Perform sentiment analysis, NLP, or content analysis.
- **Accessibility:** Provide readable transcripts for hearing-impaired users.
- **SEO & Summarization:** Create searchable summaries and improve discoverability.
- **Education:** Collect lecture or tutorial transcripts for study and reference.

***

### 📥 Inputs

#### What does the scraper accept?

- **YouTube Video URL** (e.g., `https://www.youtube.com/watch?v=dQw4w9WgXcQ`)

> **Note:** The video must have captions enabled (either user-uploaded or auto-generated).

***

### 🔒 Restrictions

- Only works with videos that have available transcripts.
- Some videos (e.g., live streams, private videos) may not provide transcripts.

***

### ✅ Example Input

```json
{
  "videoUrl": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jzEbj3w8bDY"
    ]
}
```

***

### 📤 Outputs

#### What does the scraper return?

- **JSON**: Structured transcript with timestamps and text.
- **Plain Text**: Clean, readable transcript.

##### Example Output (JSON)

```json
{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Never Gonna Give You Up",
  "transcript": [
    { "timestamp": "0:00", "text": "We're no strangers to love" },
    { "timestamp": "0:05", "text": "You know the rules and so do I" },
    { "timestamp": "0:10", "text": "A full commitment's what I'm thinking of" }
  ]
}
```

##### Example Output (Plain Text)

```
0:00 We're no strangers to love
0:05 You know the rules and so do I
0:10 A full commitment's what I'm thinking of
```

***

### ⚙️ How to Use

1. Log in or Sign up on [Apify Platform](https://apify.com).
2. Create a new task and select "YouTube Transcript Actor".
3. Enter the YouTube video URL(s) in the startUrls field.
4. Choose whether to include timestamps (includeTimestamps: "toggle ON" or    "toggle OFF").
5. Start the task and receive your transcript in JSON format.

***

### 🛠️ Troubleshooting

| Issue                | Possible Cause                        | Solution                        |
|----------------------|---------------------------------------|---------------------------------|
| Transcript not found | Video has no captions                 | Try another video               |
| Invalid URL/ID       | Input is incorrect or missing         | Check and re-enter the input    |
| Empty transcript     | YouTube restricted the transcript     | Try another video or region     |

***

### 🔗 Additional Resources

- [YouTube API Documentation](https://developers.google.com/youtube/v3/docs)
- [Apify Platform](https://apify.com/)
- [My Profile](https://apify.com/vistics)

***

### 🙌 Acknowledgments

This tool was built with the support of the open-source community and the YouTube API. Special thanks to all contributors! 🎉

# Actor input Schema

## `timestamps` (type: `boolean`):

If true, returns transcript array with timestamps. If false, returns joined text only.

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

List of YouTube video URLs to scrape transcripts from

## Actor input object example

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

# 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=SieELGaJV8k"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vistics/youtube-transcript-scraper-1-1k-results").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=SieELGaJV8k"] }

# Run the Actor and wait for it to finish
run = client.actor("vistics/youtube-transcript-scraper-1-1k-results").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=SieELGaJV8k"
  ]
}' |
apify call vistics/youtube-transcript-scraper-1-1k-results --silent --output-dataset

```

## MCP server setup

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

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/N34cpAJ2EaAdDdF3e/builds/PBogGxMSfzKibOpKU/openapi.json
