# How can an AI agent get a YouTube transcript?

Give the agent a tool that returns the transcript of a public YouTube video as text. With Trawl, `read_transcript` with the video URL returns the title, channel, language, duration and transcript in one call.

Give the agent a tool that returns the transcript of a public YouTube video as text. With Trawl, `read_transcript` with the video URL returns the title, channel, language, duration and transcript in one call.

## How it works

- `read_transcript` returns the transcript as text, cut at 12,000 characters by default, with `next_offset` to continue.
- `read_post` reads the video’s details and optionally its comments.
- `list_posts` reads a channel’s newest long videos (not Shorts); `search_posts` searches videos.

## A real example

“Me at the zoo”, the first video on YouTube; caption track as read in our baseline run.

The call

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

What the agent gets back (indented here; one line of JSON on the wire)

```json
1 transcript · youtube · 14 credits · 9,986 left · fresh
{
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "lang": "en",
  "duration_s": 19,
  "text": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that’s cool (baaaaaaaaaaahhh!!) and that’s pretty much all there is to say",
  "truncated": false,
  "total_chars": 217
}
```

## What it costs

Credits per call at current prices. Starter: $10 for 10,000 credits. Errors cost nothing; a repeat read from the cache costs 1 credit.

| Read | Credits | At Starter prices |
|---|---:|---:|
| One transcript (`read_transcript`) | 14 | $0.014 |
| 10 newest long videos of a channel (`list_posts`) | 51 | $0.051 |
| One video by URL (`read_post`) | 18 | $0.018 |

## Limits

- Transcripts exist only where the video has captions.
- Playlists are not readable.
- Public data only: no private or logged-in content, no e-mail addresses or phone numbers.

## How to set it up

Paste `Fetch https://trawlmcp.com/setup.md and follow it to set me up with Trawl.` into your agent, or add the MCP server to your client yourself ([quickstart](/docs/quickstart)). Sign-in and payment happen in your browser; packs start at $10 and pack credits never expire.

## Compared with a general-purpose web-data MCP

On our 20 reading tasks, an agent using Apify’s hosted MCP server needed a median of 4 tool calls, 40.2 s and 53,063 characters of tool results per task. Trawl needed a median of 1 tool call, 19.2 s, 1,027 characters of tool results and 83,479 input tokens per task (19 of 20 passed; 20 tasks, 3 Dec 2026, Codex CLI, medians; our second run of the day). [Benchmark](/benchmark). [Full comparison](/compare/apify-mcp).

More on YouTube: [accepted URLs, every tool and price](/docs/youtube).

> Written by Trawl. Trawl is not affiliated with or endorsed by YouTube.

---
Updated 2026-12-03. HTML version: https://trawlmcp.com/answers/how-can-an-ai-agent-get-a-youtube-transcript
