video · transcription

YouTube Transcripts API

Retrieve transcripts (captions) from YouTube videos in any available language. Returns timestamped segments suitable for LLM ingestion, summarization, or RAG indexing. Supports both auto-generated and manually created captions.

GET/api/public/v1/youtube-transcripts
price
$0.005 USDC
atomic
5000
free tier
3 calls / agent
chain
base mainnet
asset
USDC
scheme
exact

query parameters

nametyperequireddescription
video_idstringyesYouTube video ID, watch URL, or share link
langstringno · default "en"Language code for the transcript
transcript_typeauto | manualnoTranscript source type

call it — curl

bash
# Free tier — first 3 calls per agent identity, no payment header
curl "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=0e3GPea1Tyg"

# After free tier: send a signed x402 payment header
curl "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=0e3GPea1Tyg" \
  -H "X-PAYMENT: <base64 signed USDC authorization>"

call it — typescript + x402-fetch

typescript
import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPayment(
  "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=0e3GPea1Tyg"
);
const data = await res.json();
console.log(data.transcripts);

response — 200 ok

application/json
{
  "search_metadata": {
    "id": "search_...",
    "status": "Success",
    "created_at": "2026-06-18T12:00:00Z"
  },
  "search_parameters": {
    "engine": "youtube_transcripts",
    "video_id": "0e3GPea1Tyg",
    "lang": "en"
  },
  "transcripts": [
    { "text": "Welcome back to the channel.",
      "start": 0.0, "duration": 3.1 },
    { "text": "Today we're looking at...",
      "start": 3.1, "duration": 4.5 }
  ],
  "available_languages": [
    { "name": "English", "lang": "en" },
    { "name": "Spanish", "lang": "es" }
  ]
}

status codes

200transcript returned, response includes X-PAYMENT-RESPONSE receipt when paid
400missing or invalid video_id
402free tier exhausted or invalid X-PAYMENT — body contains accepts[] payment requirements
429upstream rate limit — retry with backoff
500upstream or settlement error