# YouTube Transcript & Content Extractor (`fixitfoundry/youtube-transcript-actor`) Actor

Extract full transcripts with timestamps, video metadata (views, likes, duration, publish date), and channel info from any public YouTube video.

- **URL**: https://apify.com/fixitfoundry/youtube-transcript-actor.md
- **Developed by:** [Jesse Casco](https://apify.com/fixitfoundry) (community)
- **Categories:** Videos, Developer tools, Automation
- **Stats:** 1 total users, 0 monthly users, 96.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Transcript & Content Extractor

Extract transcripts and metadata from YouTube videos with pay-per-event pricing.

### Features

- ✅ Full transcript extraction with timestamps
- ✅ Video metadata (title, author, thumbnail, URL)
- ✅ JSON and CSV output formats
- ✅ Single video processing
- ✅ Pay-per-event monetization ($0.50/video)

### Pricing

**$0.50 per video processed**

You only pay for successful video extractions. Failed extractions are not charged.

### Input

```json
{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "format": "json",
  "maxVideos": 1
}
```

#### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | string | Yes | - | YouTube video URL |
| `format` | string | No | `json` | Output format: `json` or `csv` |
| `maxVideos` | integer | No | `1` | Max videos to process (for playlists) |

### Output

#### JSON Format

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Video Title",
  "author": "Channel Name",
  "authorUrl": "https://www.youtube.com/channel/...",
  "thumbnail": "https://i.ytimg.com/vi/...",
  "url": "https://www.youtube.com/watch?v=...",
  "transcript": [
    {
      "text": "Transcript text...",
      "duration": 5.0,
      "offset": 0.0
    }
  ],
  "processedAt": "2024-01-01T00:00:00.000Z"
}
```

### Usage Examples

#### Single Video

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
```

#### CSV Output

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "format": "csv"
}
```

### Local Development

```bash
## Install dependencies
npm install

## Run locally
apify run

## Or with Node directly
npm start
```

### Deployment

```bash
## Login to Apify
apify login

## Deploy
apify push
```

### Limitations

- Playlist support requires YouTube Data API integration (future enhancement)
- Some videos may not have transcripts available
- Transcript language defaults to English when available

### Legal & Compliance

This actor uses publicly available YouTube data via oEmbed API and transcript extraction. No authentication or API keys required.

### Support

For issues or questions, please open an issue on GitHub.

# Actor input Schema

## `url` (type: `string`):

YouTube video or playlist URL

## `format` (type: `string`):

Output format for dataset

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

Preferred transcript language code (e.g., en, es, fr). Leave empty for auto-detect.

## Actor input object example

```json
{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "format": "json"
}
```

# Actor output Schema

## `videoId` (type: `string`):

YouTube video identifier

## `title` (type: `string`):

Title of the YouTube video

## `author` (type: `string`):

Channel name of the video creator

## `authorUrl` (type: `string`):

Link to the author's channel

## `thumbnail` (type: `string`):

URL to the video thumbnail image

## `url` (type: `string`):

Direct link to the YouTube video

## `viewCount` (type: `string`):

Total number of views

## `likeCount` (type: `string`):

Total number of likes

## `durationSeconds` (type: `string`):

Video duration in seconds

## `publishDate` (type: `string`):

Date when the video was published

## `channelId` (type: `string`):

YouTube channel identifier

## `subscriberCount` (type: `string`):

Number of channel subscribers

## `description` (type: `string`):

Video description text

## `transcript` (type: `string`):

Transcript segments with text, duration, and offset

## `processedAt` (type: `string`):

Timestamp when the video was processed

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

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

# Run the Actor and wait for it to finish
run = client.actor("fixitfoundry/youtube-transcript-actor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}' |
apify call fixitfoundry/youtube-transcript-actor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fixitfoundry/youtube-transcript-actor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6TZLdakwXduAxLS1l/builds/7NJmvcR6fGgFLUsis/openapi.json
