LurkAPI
Docs · Video transcript

Video transcript

What's said in a video or Short: its captions as timed segments and as one block of text.

1 credit per callFresh within 30 daysMCP tool: youtube_transcript
GEThttps://api.lurkapi.com/v1/youtube/video/transcript

Example responseView as markdown

When to use this

Use it to turn a video into text for summaries, search, research or repurposing. It reads the video's captions: the creator's own or YouTube's auto-generated ones (isGenerated tells them apart).

Pick a language with language (e.g. es); without it you get English when the video has it, else the video's main language. availableLanguages lists every caption track. YouTube's machine translation isn't available, so a language the video has no captions in returns 404.

Videos without captions, and private or removed ones, return 404 not_found.

Parameters

All parameters go in the query string.

ParameterDescription
url
stringrequired
The video's URL (watch, youtu.be, /shorts/, /live/ or /embed/ links all work) or its 11-character id, e.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ.
Example
https://www.youtube.com/watch?v=dQw4w9WgXcQ
language
stringoptional
Language code, e.g. en, es or pt-BR. pt also matches pt-BR. Default: English if the video has it, else its main language.

Example request

Replace YOUR_API_KEY with your key, or set LURKAPI_KEY for the code. Get a free key.

Language

Example response

A real response from this endpoint, captured from the live API and trimmed to a couple of items. Strings over 96 characters (mostly signed media URLs) are cut short and end in ….

Show the example response (2 KB)
{
  "success": true,
  "credits_remaining": 999983,
  "credits_charged": 1,
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "language": "English",
  "languageCode": "en",
  "isGenerated": false,
  "transcript": [
    {
      "text": "♪ We're no strangers to love ♪",
      "startMs": 18640,
      "endMs": 21880,
      "startTimeText": "0:18"
    },
    {
      "text": "♪ You know the rules and so do I ♪",
      "startMs": 22640,
      "endMs": 26960,
      "startTimeText": "0:22"
    }
  ],
  "transcript_only_text": "♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪",
  "availableLanguages": [
    {
      "code": "en",
      "name": "English",
      "isGenerated": false
    },
    {
      "code": "en",
      "name": "English",
      "isGenerated": true
    },
    {
      "code": "de-DE",
      "name": "German (Germany)",
      "isGenerated": false
    },
    {
      "code": "ja",
      "name": "Japanese",
      "isGenerated": false
    },
    {
      "code": "pt-BR",
      "name": "Portuguese (Brazil)",
      "isGenerated": false
    },
    {
      "code": "es-419",
      "name": "Spanish (Latin America)",
      "isGenerated": false
    }
  ]
}

Response fields

Every field of a successful response. [] marks a list: a[].b is the b of each item in a. nullable fields can be null; optional fields can be missing.

Show all 18 fields
FieldTypeDescription
successtrueAlways true here; errors have success: false.
credits_remainingnumberYour balance after this call. On anonymous playground calls: free tries left today.
credits_chargednumberCredits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1).
videoIdstringVideo id.
urlstringLink to the video.
languagestringLanguage of the transcript, e.g. "English".
languageCodestringIts code as YouTube names the track, e.g. en or pt-BR.
isGeneratedbooleanAuto-generated by YouTube's speech recognition, rather than captions the creator uploaded.
transcriptobject[]Timed segments, in order.
transcript[].textstringWhat's said in this segment.
transcript[].startMsnumberSegment start, ms from the start of the video.
transcript[].endMsnumberSegment end, ms; never past the next segment's start.
transcript[].startTimeTextstringSegment start as a timestamp, e.g. "1:23".
transcript_only_textstringThe whole transcript as one string, without timestamps.
availableLanguagesobject[]Every caption track the video has.
availableLanguages[].codestringLanguage code; pass it as language.
availableLanguages[].namestringLanguage name, e.g. "English".
availableLanguages[].isGeneratedbooleanAuto-generated rather than uploaded by the creator.

Caching and freshness

Responses are cached for up to 30 days, so a repeat call within that window can return the same data. It still costs 1 credit.

Errors

Errors return { success: false, error, code, docs } with the HTTP status below. Validation errors, 401/402/429 rejections and 5xx failures are free; not_found is charged (how charging works). All error codes.

StatusCodeMeaning
401missing_api_keyNo API key. Send it in the x-api-key header.
401invalid_api_keyThe key is unknown or was revoked.
402insufficient_creditsNot enough credits for this call. Buy a pack or wait for tomorrow's top-up.
404not_foundThe endpoint, or the thing you asked for (ad, post, subreddit), doesn't exist. Charged when the platform was checked.
405method_not_allowedEndpoints take GET with query params.
429rate_limitedToo many calls at once. Wait for the retry-after seconds, then retry.
500internal_errorSomething broke on our side. Retry; 5xx errors are free.
502upstream_errorThe platform didn't give a usable answer. Retry; 5xx errors are free.
503upstream_busyAll our connections to the platform are busy. Retry in a few seconds; 5xx errors are free.
504upstream_timeoutThe platform took over 30 seconds to answer. Retry; timeouts are free.

Use it in Claude

Once LurkAPI is connected to Claude, this endpoint is the youtube_transcript tool. Ask in plain English, for example:

Ask Claude
Use LurkAPI's youtube_transcript with url "https://www.youtube.com/watch?v=dQw4w9WgXcQ" and summarize what you find.

Claude calls youtube_transcript with arguments like these, and each call costs 1 credit:

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

Tool results skip nulls and empty lists to save tokens.