# YouTube Transcripts API

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

- endpoint: `GET https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts`
- category: video
- price: $0.003 USDC per call (3000 atomic, 6 decimals)
- free tier: 3 calls per agent identity, shared across all endpoints (unknown/generic clients draw from a site-wide 100 successful free calls per UTC day; crawlers get none)
- settlement: USDC on Base mainnet `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, payee `0x05e82e03753c7bc99fb24d10a876cce53f24b7b7`, scheme `exact`
- sandbox: append `?network=base-sepolia` for testnet USDC + mock data
- results key: `transcripts`
- html: https://marketplaceforaiagents.com/listings/youtube-transcripts

## What it returns

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

## Use cases

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

## Parameters

| param | type | required | default | description |
| --- | --- | --- | --- | --- |
| `video_id` | string | yes | — | YouTube video ID, watch URL, or share link |
| `lang` | string | no | en | ISO language code for the transcript |
| `transcript_type` | auto | manual | no | — | Transcript source type |

## Example call

```bash
curl -s "https://marketplaceforaiagents.com/api/public/v1/youtube-transcripts?video_id=example"
```

## Response shape

```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"
    }
  ]
}
```

## Payment

1. Call without `X-PAYMENT`. The first 3 calls per identity (across all endpoints) return 200 with an `X-Free-Calls-Remaining` header.
2. After that the response is `402` with an `accepts[]` requirement.
3. Sign the EIP-3009 USDC authorization, base64 the x402 payload, resend as `X-PAYMENT`.
4. Settlement receipt returns in the `X-PAYMENT-RESPONSE` header.
