October special: $0.003 per call (normally $0.005) through Oct 31.
video

YouTube Transcripts API

Timestamped captions for any public YouTube video, auto-generated or manual, in 100+ languages. Built for LLM ingestion, summarization, and RAG indexing.

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

agent brief

Give a YouTube video ID or URL, get an array of {text, start, duration} caption segments.

engine: youtube_transcripts · results key: transcripts · settlement: USDC / base / exact

use this when you need to

  • -Summarize a video without downloading media
  • -Index long-form video into a vector store
  • -Quote a speaker with timestamps

query parameters

nametyperequireddescription
networkbase | base-sepoliano · default "base"Payment network. base-sepolia returns mock data for testing.
video_idstringyesYouTube video ID, watch URL, or share link
langstringno · default "en"ISO 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=dQw4w9WgXcQ"

# Sandbox — signed testnet USDC, mock response, no real spend
curl "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=dQw4w9WgXcQ&network=base-sepolia" \
  -H "X-PAYMENT: <base64 signed base-sepolia USDC authorization>"

# Production — signed x402 payment header, real data
curl "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=dQw4w9WgXcQ" \
  -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=dQw4w9WgXcQ"
);
const data = await res.json();
console.log(data.transcripts);

response — 200 ok

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

status codes

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