# YouTube Transcript for AI Agents (`emttn/youtube-transcript`) Actor

Get YouTube transcripts with timestamps from the captions (subtitles) of any public video that has them: a YouTube transcript scraper and API that extracts the text of up to 100 videos per run for AI agents, LLMs and MCP. Pay only for the transcripts delivered.

- **URL**: https://apify.com/emttn/youtube-transcript.md
- **Developed by:** [Frameskim Tools](https://apify.com/emttn) (community)
- **Categories:** Videos, AI, Agents
- **Stats:** 2 total users, 1 monthly users, 66.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 transcript delivereds

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 for AI Agents

**Give your agent the words of a YouTube video.** This actor turns public YouTube URLs into transcripts with timestamps, ready to paste into an LLM: built for AI agents, and one call away from Claude and other agents through the Apify MCP server.

### What it does

Send up to 100 single video URLs per run. For each video you get one dataset item:

- `videoId`, `title` and `lang` (the language of the captions used).
- `segments`: the transcript as `{ start, end, text }` in seconds.
- `text`: the whole transcript as one string.
- `frameskimUrl`: a link to [Frameskim](https://apify.com/emttn/frameskim), the sister actor for frames, screenshots and moments of the same videos.

A video that has no captions, or that YouTube blocks, becomes an item with `videoId` and `error` and is not charged. If YouTube blocks the video's metadata but the transcript is available, `title` is an empty string.

### Pricing

Pay per event, no subscription. Apify bills each event and never more than the spending limit you set for the run.

| Event | Price (USD) | When |
|---|---|---|
| `transcript` | $0.01 | Per transcript delivered |

What fails is not charged: a video without a transcript, a blocked video, a video that takes too long and every video left after a stop (see Limits) cost nothing. If every video fails, the run ends with the reason and "Nothing was charged."

### Examples

Input:

```json
{ "urls": ["https://youtu.be/fWjsdhR3z3c", "https://www.youtube.com/watch?v=4czjS9h4Fpg"], "lang": "en" }
```

Output (one item per video, values shortened):

```json
{ "videoId": "fWjsdhR3z3c", "title": "...", "lang": "en", "segments": [{ "start": 0.0, "end": 4.2, "text": "..." }], "text": "...", "frameskimUrl": "https://apify.com/emttn/frameskim" }
```

A video that failed:

```json
{ "videoId": "abc123def45", "error": "..." }
```

### Use it by API

```bash
curl -X POST "https://api.apify.com/v2/acts/emttn~youtube-transcript/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"urls": ["https://youtu.be/fWjsdhR3z3c"]}'
```

### Use it from Claude (MCP)

Add the Apify MCP server with this actor as a tool:

```json
{ "mcpServers": { "apify": { "url": "https://mcp.apify.com/?actors=emttn/youtube-transcript" } } }
```

Then ask, for example: "Use YouTube Transcript to read this video and summarize it."

The tool starts a run and returns its status; the agent then reads the results with the server's `get-dataset-items` tool.

### Limits

- Single public videos only: no channels, playlists or searches. More than 100 URLs, or any URL that is not a single video, is refused before anything is processed, with nothing charged.
- Videos are processed one after the other. A video that takes longer than 120 s is reported as failed and not charged; the batch stops after 55 minutes.
- The batch stops after 5 failures in a row, or when what the failed videos cost us exceeds 30% of what was charged for the delivered ones plus 0.01 USD. The videos left become `error` items ("Stopped: ..."), nothing is charged for them, and the run still ends as succeeded with what was delivered.
- Each run respects your Apify spending limit: when it does not cover one more transcript, the batch stops and the rest are `error` items, not charged.
- Duplicate URLs (the same video twice, in any URL form) are deduplicated: the video is processed once and charged once.
- `lang` applies to the whole batch; there is no per-video language.
- Videos need captions: this actor does not transcribe audio.

### FAQ

**Which languages?** Any language the video has captions in; set `lang` (default `en`) and the actor falls back to the original language. When the video has no manual track in the requested language, YouTube's automatic translation of its captions may be returned instead; the `lang` field of each item says which language you got.

**What if a run fails?** The status message says why. A run that cannot start says "Nothing was charged."; a run that stops unexpectedly says "Only delivered transcripts were charged." and charges only the transcripts it delivered, if any. Retry later if YouTube blocked the request.

**Do you keep my transcripts?** No. They live only in your run's own Apify storage, with your plan's retention.

**Frames, screenshots or the moments that answer a question?** Use [Frameskim](https://apify.com/emttn/frameskim).

### Legal

Not affiliated with YouTube or Google. By running this actor you confirm you have the right to process each video you submit.

Takedown requests: open an issue in the Issues tab of this page or write to support@frameskim.dev. Blocked videos and channels are refused on the next run.

[Terms](https://frameskim.dev/terms) · [Privacy](https://frameskim.dev/privacy)

# Actor input Schema

## `urls` (type: `array`):

Public YouTube videos or Shorts, one URL per video, up to 100 per run. Channels, playlists and searches are not accepted.

## `lang` (type: `string`):

Transcript language code; falls back to the video's original language.

## Actor input object example

```json
{
  "urls": [
    "https://youtu.be/fWjsdhR3z3c",
    "https://youtu.be/wIyHSOugGGw",
    "https://youtu.be/s2skans2dP4"
  ],
  "lang": "en"
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items: video ID, title, language, timestamped segments, full text and a Frameskim link for frames; failed videos carry an error and are not charged.

# 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 = {
    "urls": [
        "https://youtu.be/fWjsdhR3z3c",
        "https://youtu.be/wIyHSOugGGw",
        "https://youtu.be/s2skans2dP4"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("emttn/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 = { "urls": [
        "https://youtu.be/fWjsdhR3z3c",
        "https://youtu.be/wIyHSOugGGw",
        "https://youtu.be/s2skans2dP4",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("emttn/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 '{
  "urls": [
    "https://youtu.be/fWjsdhR3z3c",
    "https://youtu.be/wIyHSOugGGw",
    "https://youtu.be/s2skans2dP4"
  ]
}' |
apify call emttn/youtube-transcript --silent --output-dataset

```

## MCP server setup

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