Answers / YouTube

How do I get the transcript of a YouTube video with an API?

Send GET /v1/youtube/transcript?id=VIDEO_ID with Authorization: Bearer YOUR_API_KEY. You can pass the 11-character ID or the full watch URL, and lang=es or another code to pick a caption language. The response has the whole text, the language and, in the standard format, every line with its start time.

YouTube · transcript · $0.003 a call · one verified website trial · updated 2026-11-13

Caption availability, comments and total workflow cost

This endpoint retrieves existing caption tracks; it is not speech recognition for videos without captions. lang selects a track that the source actually provides, not an automatic translation. No-caption failures do not debit customer credit.

A transcript and a comment sample are separate requests. Budget both calls, preserve timed segments and source URLs, and stop on errors. Model inference is a separate cost.

Limits and failures

This is read-only access to publicly visible content. Supported actions and available fields differ by platform; inspect meta.unavailable instead of assuming every metric exists. Source URLs are included when the upstream platform provides them.

Video transcripts retrieve available caption tracks. They are not speech recognition for arbitrary videos without captions. Search results and captions do not establish what appears in the video footage.

A 402 insufficient_balance response means this call was not charged: check get_account and add credit if needed. Verification or trial limits are not reset by signing in or creating another account. Upstream errors and timeouts are not charged; do not retry indefinitely.

Eligible new accounts receive $0.05 once, limited to one grant per network. Shared networks may already have claimed it. There is no recurring free credit.

Run it live

Calls run only when you press Run. Opening this page does not spend credit.

Loading…

Your results will appear here. Choose a platform and action, then press Run.

Real API calls require verification for one trial, or a signed-in account with prepaid credit.

From code

curl
curl "https://posttodata.com/v1/youtube/transcript?id=UF8uR6Z6KLc" -H "Authorization: Bearer YOUR_API_KEY"
Python
import requests

r = requests.get(
    "https://posttodata.com/v1/youtube/transcript",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"id": "UF8uR6Z6KLc"},
)
for item in r.json()["data"]["items"]:
    print(item["url"], item.get("text") or item.get("title"))

From your AI

Claude and ChatGPT clients that support OAuth can sign in without pasting a key. Follow the client setup guide. The command below is the API-key option for Claude Code.

Add the MCP server once
claude mcp add --transport http posttodata https://posttodata.com/mcp --header "Authorization: Bearer YOUR_API_KEY"

Then ask

“Get the transcript of this YouTube video and summarize its three main points with timestamps.”

The model calls get_transcript with platform youtube.

Good to know

  • Transcripts list at $0.003 per successful call. A video with no captions is not charged.
  • English is returned by default when the video has it; pass lang for another language, and the error lists the languages that exist.
  • format=markdown returns one [m:ss] line per caption, ready to paste into a model.
  • Just need one transcript? Use the free YouTube transcript generator at posttodata.com/en/tools/youtube-transcript.

Full reference in the docs. All YouTube endpoints are on the YouTube API page.

More answers