# Youtube Transcript Scraper (`topaz_sharingan/youtube-transcript-scraper`) Actor

Are you in search of a robust solution for extracting transcripts from YouTube videos? Look no further 😉, YouTube-Transcript-Scraper will meet your needs. Our software not only efficiently retrieves transcripts but also provides additional valuable information .👍 😀 Scrap away 🕵‍♂️.

- **URL**: https://apify.com/topaz_sharingan/youtube-transcript-scraper.md
- **Developed by:** [Moses Ceaser](https://apify.com/topaz_sharingan) (community)
- **Categories:** Developer tools, Social media
- **Stats:** 4,758 total users, 74 monthly users, 100.0% runs succeeded, 135 bookmarks
- **User rating**: 4.88 out of 5 stars

## Pricing

from $5.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 Actor

### Introduction

#### What is the actor's purpose?

The YouTube Transcript Actor is a powerful tool designed to extract transcripts from YouTube videos. This actor takes a YouTube video URL as input and returns the transcript of the video.

#### Key Features

- Extract transcripts from YouTube videos
- Support for multiple languages
- Customize the output format to suit your needs

#### Typical Use Cases

- Content creators can use this actor to generate transcripts for their videos
- Researchers can analyze video transcripts for sentiment analysis, topic modeling, or other natural language processing tasks
- Accessibility enthusiasts can use this actor to make video content more accessible to everyone

### Inputs

#### What kind of data does the actor take in?

The YouTube Transcript Actor takes the following input:

- **YouTube Video URL** (required): The URL of the YouTube video you want to extract the transcript from

#### Restrictions on Input Data

There are no specific restrictions on the input data other than providing a valid YouTube Video URL.

#### Examples of Input Data

```
"startUrls": ["https://www.youtube.com/watch?v=aAkMkVFwAoo"
```

### Outputs

#### What kind of data does the actor produce?

The YouTube Transcript Actor produces the following output:

- **Transcript**: The extracted transcript of the YouTube video in the specified format (e.g., plain text, JSON, etc.)

#### Restrictions on Output Data

The availability of the transcript data depends on the input YouTube video. Some videos may not have transcripts available.

#### Examples of Output Data

**Transcript:**

```
"(Light cheerful music) ♪ I don't want a lot for Christmas, ♪ ♪ there is just one thing I need. ♪ ♪ I don't care about the presents ♪ ♪ underneath the Christmas tree. ♪ ♪ I just want you for my own, ♪ ♪ more than you could ever know. ♪ ♪ Make my wish come true, ♪ ♪ all I want for Christmas is you. ♪ ♪ Yeah, ♪ ♪ I don't want a lot for Christmas, ♪ ♪ there is just one thing I need. ♪ ♪ And I don't care about the presents ♪ ♪ underneath the Christmas tree. ♪ ♪ I don't need to hang my stocking ♪ \nthere upon the fireplace. ♪ ♪ Santa Claus won't make me happy ♪ \nwith a toy on Christmas Day. ♪ ♪ I just want you for my own, ♪ \nmore than you could ever know. ♪ ♪ Make my wish come true, ♪ \n♪ all I want for Christmas is you. ♪ ♪ You, baby, ♪ \n♪ oh, I won't ask for much this Christmas. ♪ \n♪ I won't even wish for snow. ♪ \n♪ And I, I'm just gonna keep on waiting ♪ \n♪ underneath the mistletoe. ♪ \n♪ I won't make a list and send it ♪ \n♪ to the North Pole for Saint Nick. ♪ \n♪ I won't even stay awake to ♪ \nhear those magic reindeer click. ♪ \n♪ 'Cause I just want you here tonight ♪ \n♪ holding on to me so tight. ♪ \n♪ What more can I do, ♪ \noh, baby, all I want \nfor Christmas is you. ♪ \n♪ You, baby, ♪ \n♪ oh oh, all the lights are \nshining so brightly everywhere. ♪ \n♪ So brightly, baby, ♪ \n♪ and the sound of children's \nlaughter fills the air. ♪ \n♪ And everyone is singing, ♪ \n♪ I hear those sleigh bells ringing. ♪ \n♪ Santa, won't you bring \nme the one I really need? ♪ \n♪ Won't you please bring my baby to me? ♪ \n♪ Oh, I don't want a lot for Christmas, ♪ \n♪ this is all I'm asking for. ♪ \n♪ I just wanna see my baby \nstanding right outside my door. ♪ \n♪ Oh, I just want you for my own, ♪ \n♪ more than you could ever know. ♪ \n♪ Make my wish come true, ♪ \noh, baby, all I want \nfor Christmas is you. ♪ \n♪ You, baby, ♪ \n♪ all I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪"
```

### Usage

#### How to Run the Actor

1. Go to the Apify platform (https://apify.com) and log in or sign up for an account.
2. Create a new task and select the "YouTube Transcript Actor".
3. Configure the input by providing the YouTube Video URL.
4. Start the task, and the actor will begin extracting the transcript.

#### How to Interpret the Actor's Results

The actor will provide you with the extracted transcript in the specified format. You can use this data for analysis, content optimization, or any other purpose that suits your needs.

#### Examples of Usage

##### Example 1: Extract Transcript from a YouTube Video

Input:

```json
{
    "startUrls": ["https://www.youtube.com/watch?v=aAkMkVFwAoo"]
}
```

Output:

```json
{
    "channelName": "MariahCareyVEVO",
    "channelSubscription": "10.9M subscribers",
    "videoTitle": "Mariah Carey - All I Want for Christmas Is You (Make My Wish Come True Edition) - YouTube",
    "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo",
    "views": "572,070,938 views",
    "videoPostDate": "Premiered on 19 Dec 2019",
    "transcript": "(Light cheerful music) ♪ I don't want a lot for Christmas, ♪ ♪ there is just one thing I need. ♪ ♪ I don't care about the presents ♪ ♪ underneath the Christmas tree. ♪ ♪ I just want you for my own, ♪ ♪ more than you could ever know. ♪ ♪ Make my wish come true, ♪ ♪ all I want for Christmas is you. ♪ ♪ Yeah, ♪ ♪ I don't want a lot for Christmas, ♪ ♪ there is just one thing I need. ♪ ♪ And I don't care about the presents ♪ ♪ underneath the Christmas tree. ♪ ♪ I don't need to hang my stocking ♪ \nthere upon the fireplace. ♪ ♪ Santa Claus won't make me happy ♪ \nwith a toy on Christmas Day. ♪ ♪ I just want you for my own, ♪ \nmore than you could ever know. ♪ ♪ Make my wish come true, ♪ \n♪ all I want for Christmas is you. ♪ ♪ You, baby, ♪ \n♪ oh, I won't ask for much this Christmas. ♪ \n♪ I won't even wish for snow. ♪ \n♪ And I, I'm just gonna keep on waiting ♪ \n♪ underneath the mistletoe. ♪ \n♪ I won't make a list and send it ♪ \n♪ to the North Pole for Saint Nick. ♪ \n♪ I won't even stay awake to ♪ \nhear those magic reindeer click. ♪ \n♪ 'Cause I just want you here tonight ♪ \n♪ holding on to me so tight. ♪ \n♪ What more can I do, ♪ \noh, baby, all I want \nfor Christmas is you. ♪ \n♪ You, baby, ♪ \n♪ oh oh, all the lights are \nshining so brightly everywhere. ♪ \n♪ So brightly, baby, ♪ \n♪ and the sound of children's \nlaughter fills the air. ♪ \n♪ And everyone is singing, ♪ \n♪ I hear those sleigh bells ringing. ♪ \n♪ Santa, won't you bring \nme the one I really need? ♪ \n♪ Won't you please bring my baby to me? ♪ \n♪ Oh, I don't want a lot for Christmas, ♪ \n♪ this is all I'm asking for. ♪ \n♪ I just wanna see my baby \nstanding right outside my door. ♪ \n♪ Oh, I just want you for my own, ♪ \n♪ more than you could ever know. ♪ \n♪ Make my wish come true, ♪ \noh, baby, all I want \nfor Christmas is you. ♪ \n♪ You, baby, ♪ \n♪ all I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪ \n♪ All I want for Christmas is you, baby. ♪"
}
```

### Troubleshooting

#### Common Problems and How to Solve Them

1. **Invalid YouTube Video URL**: Make sure you provide a valid YouTube video URL.
2. **Transcript Not Available**: If the video does not have a transcript available, the actor will return "null".

### Additional Information

#### Links to Related Resources

- [Alternative YouTube Transcript Actor](https://apify.com/vistics/youtube-transcript-scraper-2-1k-results)
- [Apify Platform](https://apify.com)
- [Checkout my profile](https://apify.com/topaz_sharingan)

#### Acknowledgments

This actor was developed with the support of the Apify community and the YouTube API. We thank all contributors for their valuable input and feedback in making this tool available.

# 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("topaz_sharingan/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=SieELGaJV8k"] }

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

```

## MCP server setup

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