# Youtube Transcript - 1$/month (`insight_api_labs/youtube-transcript`) Actor

Youtube Transcript (with video details and transcript timestamps)

- **URL**: https://apify.com/insight_api_labs/youtube-transcript.md
- **Developed by:** [InsightAPILabs](https://apify.com/insight_api_labs) (community)
- **Categories:** Automation, Videos, AI
- **Features:** Limited permissions
- **Stats:** 946 total users, 5 monthly users, 93.5% runs succeeded, 78 bookmarks
- **User rating**: 3.13 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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: The Most Efficient and Reliable YouTube Transcript Scraper on Apify

Our YouTube Transcript Scraper is the fastest, most cost-effective, and reliable tool on Apify for extracting transcripts from YouTube videos. Whether you're conducting research, analyzing video content, or creating a transcript database, this scraper handles all the work quickly and at an affordable price. Here's how to get started:

#### 🚀 How to Use:

To begin, simply provide a list of YouTube video URLs for which you want to retrieve the transcript data. The scraper will then fetch the relevant information for you.

**Input:**

- **Video URLs (`video_urls`)**: An array of YouTube video URLs you want to scrape the transcript from.\
  Ensure that the video URLs contain either `youtube.com/watch?v=` or `youtu.be/` followed by the video ID.\
  Example URLs:
  - `https://www.youtube.com/watch?v=FqZYHHNntk0`
  - `https://youtu.be/FqZYHHNntk0`

For videos without a transcript, the data will include only the video details.

Once you've entered your video URLs, let our scraper do the rest!

#### 📊 Data Fields Explained: A Breakdown of Each Column

Here’s a breakdown of the data you'll receive from the scraper:

##### 📝 Transcript Data

- **transcript**: The full transcript of the video, including all spoken content.
- **transcriptWithTimestamp**: The transcript data, but with timestamps added, indicating when each part of the transcript was spoken in the video.

##### 🎥 Video Details

- **channelName**: The name of the YouTube channel that uploaded the video.
- **channelSubscription**: The number of subscribers the channel has.
- **videoTitle**: The title of the YouTube video.
- **url**: The URL of the YouTube video.
- **views**: The number of views the video has received.
- **videoPostDate**: The date when the video was posted.

#### 📈 Use Cases:

- **Content Analysis**: Extract and analyze spoken content for research, summaries, or understanding video themes.
- **Accessibility**: Create transcripts for making videos more accessible to a wider audience.
- **Text Mining**: Use the transcript data for further processing, sentiment analysis, or keyword extraction.

#### 💡 Key Benefits:

- Automate the extraction of YouTube video transcripts.
- Easily analyze or integrate transcript data into other tools for deeper insights.
- Get full, accurate transcripts and timestamped data to enhance content understanding.

By using this scraper, you can effortlessly access YouTube video transcripts, saving time and effort in collecting content data for various use cases! 🚀

Input Example

```json
{
  "input": {
    "video_urls": [
      {
        "url": "https://www.youtube.com/watch?v=FqZYHHNntk0"
      },
      {
        "url": "https://www.youtube.com/watch?v=cMsaj4SSwCw"
      }
    ]
  }
}
```

Output Example

```json
{
  "output": [
    {
      "channelName": "Scarlet Grunt",
      "channelSubscription": "9.78K subscribers",
      "videoTitle": "Crazy? I was crazy once!",
      "url": "https://www.youtube.com/watch?v=FqZYHHNntk0",
      "views": "3,451,159 views",
      "videoPostDate": "Oct 15, 2007",
      "transcript": "crazy I was crazy once they put me in a room a rubber room there ever rats rats I hate rats they make me crazy ...",
      "transcriptWithTimestamps": [
        {
          "timestamp": "0:01",
          "text": "crazy I was crazy once they put me in a"
        },
        {
          "timestamp": "0:05",
          "text": "room a rubber"
        },
        {
          "timestamp": "0:07",
          "text": "room there ever rats rats I hate rats"
        },
        {
          "timestamp": "0:12",
          "text": "they make me crazy"
        },
        {
          "timestamp": "...",
          "text": "..."}
      ]
    },...
  ]
}
```

# Actor input Schema

## `video_urls` (type: `array`):

YouTube video URLs to start with.

## Actor input object example

```json
{
  "video_urls": [
    {
      "url": "https://www.youtube.com/watch?v=FqZYHHNntk0"
    }
  ]
}
```

# 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 = {
    "video_urls": [
        {
            "url": "https://www.youtube.com/watch?v=FqZYHHNntk0"
        }
    ]
};

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

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

```

## MCP server setup

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

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/fWIyRKfnKlxB1r5CX/builds/A1wwORkv44qJ7O1xk/openapi.json
