Social media5 min readBy Purrkey teamUpdated

How to fetch a YouTube video transcript with provenance

Get a YouTube video or Short transcript with timed segments, language, and caption provenance for analysis

On this page

You have 12 YouTube videos and Shorts to review for a product launch and need each transcript with timestamps plus a flag that says whether the captions are creator-written or speech-recognized. The output feeds a decision on which claims to quote and which wording needs manual checking. No run has been executed for this guide; the table below is a design, not a result

The deliverable table

One row per video. Values here are placeholders showing the shape

videoIdtitlechannelcreatedUtcdurationSecondslanguageisAutoGeneratedtranscriptsegments
AbCdEf12345(video title)(channel name)(Unix seconds)(duration)entrue(joined text)(startSeconds, endSeconds, text)

Keep transcript and segments in the same row so a quote can be checked against its timecode. The segments cell is a list of timed objects; keep start and end seconds with each text span. If the same review also needs channel stats and links, pair this table with the companion guide on checking YouTube channel stats and links

The input the tool takes

The call is through POST /v1/runs with toolId anyapi.youtube.video_transcript_full. The contract requires url, the YouTube watch or Shorts URL copied from the browser. Example input: https://www.youtube.com/watch?v=AbCdEf12345. Replace it with your own URL

The contract also defines captionKind, language and requireFields. captionKind defaults to any; manual accepts creator-written captions and automatic accepts YouTube speech recognition. language is the preferred caption code and defaults to English. requireFields names output fields such as views; omit it for cheapest routing. When the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a transcript that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge

Step 1: choose caption kind and language

Set captionKind before the run. With captionKind set to manual or automatic, no other language is returned when the preferred language is missing. That is the limit to place next to this step: if you need a Spanish transcript and set manual, a video without manual Spanish captions will not fall back to another language. With any, if the video has no captions in the requested language, you get a transcript in another language the video has, and the language field in the result says which

Step 2: read the output fields that drive the decision

Read found first. If it is false, reason is not_found; the contract calls that a successful call, not an error. When found is true, data holds the row

isAutoGenerated is the provenance flag for the caption track: true means YouTube generated it by speech recognition rather than the creator supplying it. Automatic captions carry recognition errors, especially on names and jargon, so mark those rows for manual checking before quoting. isAiGenerated is a separate field: true when the words were recognized from the audio by the serving lane rather than read from any YouTube caption track, or null when the serving source does not say

language says which caption language the result uses. segments is the timed list in playback order, with startSeconds, endSeconds and text for each segment. transcript is the joined text. durationSeconds helps you size quote checks; createdUtc is Unix seconds, so multiply by 1000 for a JS Date in milliseconds

The agent prompt

Use this prompt with the example URL replaced by a real watch or Shorts URL from your list. The prompt tells the agent to check the current inputs and price of anyapi.youtube.video_transcript_full before running and to return a table. For a 12-video review, run the prompt once per URL or adapt it to loop over a list; the table columns stay the same

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to fetch the transcript for the YouTube URL below. Check the current inputs and price of anyapi.youtube.video_transcript_full before running anything. Use captionKind any and language en. Leave requireFields out so routing uses the cheapest source. Return one table with videoId, title, channel, createdUtc, durationSeconds, language, isAutoGenerated, transcript and segments. Keep transcript and segments in the same row. If found is false, return a row that says not_found and no transcript.

https://www.youtube.com/watch?v=AbCdEf12345

Estimated tool cost

Prices are from the Purrkey catalog, read November 13, 2026. The catalog lists anyapi.youtube.video_transcript_full at up to $0.003 per call. It uses unit max_call: "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings. Model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
Single-video transcriptcalls x max price$0.003 per call1$0.003
12-video reviewcalls x max price$0.003 per call12$0.036

The table uses no requireFields, so it uses the price above. Naming views can raise the quoted price

Next action

Start with the first URL in your list and run anyapi.youtube.video_transcript_full through the tool page: YouTube tools

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with YouTube.
Explore YouTube tools and pricing

FAQ

How do I fetch a YouTube transcript with timestamps and caption provenance?

Use anyapi.youtube.video_transcript_full with the video url; the result includes segments with startSeconds, endSeconds and text, plus transcript, language and isAutoGenerated.

What inputs does anyapi.youtube.video_transcript_full take?

The contract requires url, the YouTube watch or Shorts URL. It also defines captionKind, language and requireFields; captionKind defaults to any, language defaults to English, and you omit requireFields for cheapest routing.

What does isAutoGenerated mean for a YouTube transcript?

True means YouTube generated the caption track by speech recognition rather than the creator supplying it. Automatic captions carry recognition errors, especially on names and jargon, so mark those rows for manual checking.

What happens if the preferred caption language is missing?

With captionKind set to any, you get a transcript in another language the video has, and the language field says which. With captionKind set to manual or automatic, no other language is returned when the preferred language is missing.

How much does it cost to fetch transcripts for 12 YouTube videos?

The cost table plans 12 calls at $0.003 per call for a total of $0.036. One call for a single video is $0.003 in the same table.

What does found false mean for a YouTube transcript call?

found false with reason of not_found means there is no result. The contract calls that a successful call, not an error; when found is true, data holds the transcript row.

Can I request creator-written captions only?

Set captionKind to manual to accept creator-written captions. If the preferred language is missing, no other language is returned.

Next step

Try this with YouTube

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See YouTube tools

Share this article