API Documentation
Fetch YouTube transcripts programmatically with our REST API
Your API Key
Upgrade to Pro to get your API key
api_access_xxxxxxxxxxxxxxxxxxxxxxxxxxAPI 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
/transcriptFetch transcript for a YouTube video.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
v | string | YouTube video ID (required) |
lang | string | Language 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/textGet transcript as plain text (with optional timestamps).
Additional Parameters
| Parameter | Type | Description |
|---|---|---|
timestamps | boolean | Include timestamps (default: false) |
Rate Limits
| Plan | Requests/Month | Response Time |
|---|---|---|
| Pro | 1,000 | ~500ms avg |
| Pro+ | 5,000 | ~500ms avg |
| Enterprise | Unlimited | ~500ms avg |
Error Codes
| Code | Description |
|---|---|
400 | Invalid or missing video ID |
401 | Invalid or missing API key |
429 | Rate limit exceeded |
500 | No transcript available for this video |