API Documentation

Fetch YouTube transcripts programmatically with our REST API

Your API Key

Upgrade to Pro to get your API key

api_access_xxxxxxxxxxxxxxxxxxxxxxxxxx

API access requires a Pro or Pro+ plan.

Quick Start

Fetch a transcript (cURL)

curl -X GET "https://api.lunaa.xyz/transcript?v=dQw4w9WgXcQ&lang=en" \
  -H "X-API-Key: api_access_xxxxxxxxxxxxxxxxxxxxxxxxxx"

JavaScript / Node.js

const response = await fetch(
  "https://api.lunaa.xyz/transcript?v=dQw4w9WgXcQ&lang=en",
  {
    headers: {
      "X-API-Key": "api_access_xxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
  }
);

const data = await response.json();
console.log(data.transcript);

Python

import requests

response = requests.get(
    "https://api.lunaa.xyz/transcript",
    params={"v": "dQw4w9WgXcQ", "lang": "en"},
    headers={"X-API-Key": "api_access_xxxxxxxxxxxxxxxxxxxxxxxxxx"}
)

data = response.json()
print(data["transcript"])

Endpoints

GET/transcript

Fetch transcript for a YouTube video.

Query Parameters

ParameterTypeDescription
vstringYouTube video ID (required)
langstringLanguage code, e.g., "en" (default: "en")

Response

{
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up",
  "transcript": [
    { "text": "We're no strangers to love", "start": 0.0, "duration": 2.5 },
    { "text": "You know the rules and so do I", "start": 2.5, "duration": 3.0 }
  ],
  "language": "en"
}
GET/transcript/text

Get transcript as plain text (with optional timestamps).

Additional Parameters

ParameterTypeDescription
timestampsbooleanInclude timestamps (default: false)

Rate Limits

PlanRequests/MonthResponse Time
Pro1,000~500ms avg
Pro+5,000~500ms avg
EnterpriseUnlimited~500ms avg

Error Codes

CodeDescription
400Invalid or missing video ID
401Invalid or missing API key
429Rate limit exceeded
500No transcript available for this video