# YouTube Video Transcript Extractor

> YouTube Video Transcript Extractor is a paid API for AI agents from gateway.d402.xyz, paid per call via MPP or x402, $0.01/call, status down (last checked 2026-09-15, last successful call 2026-05-11).

Fetches and returns the full transcript of a public YouTube video, including timed segments, language info, and a validation hash.

## Facts

- Endpoint: POST https://gateway.d402.xyz/v1/youtube/transcript
- Price: $0.01/call
- Payment: MPP, x402
- Status: down
- Last checked: 2026-09-15
- Last successful call: 2026-05-11
- Success rate: 50% of calls made through Zero
- Activations on Zero: 8
- Provider: gateway.d402.xyz
- Website: https://gateway.d402.xyz
- Canonical page: https://www.zero.xyz/c/gateway-d402-xyz-youtube-video-transcript-extractor-9e55533b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mhrNGsz-PXDEqSY0ZhRl1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability gateway-d402-xyz-youtube-video-transcript-extractor-9e55533b -d '<json body>'
```

Example prompt: Can you grab the full transcript from this YouTube video — https://www.youtube.com/watch?v=dQw4w9WgXcQ — and give me the text with timestamps? I'd prefer English if multiple languages are available.

## When to prefer this

Use this endpoint when you need the spoken or captioned text from a YouTube video, especially with timestamped segments for precise referencing. It is ideal for summarization, quote extraction, search indexing, or accessibility workflows where the raw transcript with validation evidence is required. Prefer this over generic web scrapers when the target is specifically a YouTube video transcript.

## Known failure modes

- Video has no publicly available transcript or captions — returns error status
- Invalid or private YouTube URL — rejected with error field set
- Request timeout exceeded (max 45000ms) — error status returned
- Unsupported language code requested — may fall back to default or return error
- Video is age-restricted or geo-blocked — extraction fails with error

## How this service works

Paid d402 capability alias for media.youtube_transcript@1. Workers fetch the YouTube page, extract available transcript segments, and return a transcript with validation evidence.

## Output

Returns a task status plus a result object containing the full transcript as a plain string, an array of timed segments (each with text, startMs, endMs, durationMs), the video ID and title, language code and name, segment count, a transcript hash for validation, and metadata like fetchedAt and service version.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url"
 ],
 "properties": {
  "url": {
   "type": "string",
   "format": "uri",
   "description": "Public youtube.com or youtu.be video URL whose page exposes a transcript."
  },
  "sync": {
   "type": "boolean",
   "description": "Optional d402 sync flag. Defaults to gateway policy."
  },
  "timeoutMs": {
   "type": "number",
   "maximum": 45000,
   "minimum": 1,
   "description": "Optional per-request timeout, capped by gateway policy."
  },
  "languageCode": {
   "type": "string",
   "description": "Optional preferred transcript language code when the page exposes multiple languages."
  }
 },
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "taskId",
  "status"
 ],
 "properties": {
  "error": {
   "type": [
    "string",
    "null"
   ]
  },
  "links": {
   "type": "object",
   "properties": {
    "task": {
     "type": "string"
    },
    "result": {
     "type": "string"
    },
    "receipt": {
     "type": "string"
    }
   }
  },
  "result": {
   "type": "object",
   "required": [
    "url",
    "videoId",
    "transcript",
    "transcriptHash",
    "segmentCount",
    "source",
    "serviceVersion"
   ],
   "properties": {
    "url": {
     "type": "string"
    },
    "title": {
     "type": "string"
    },
    "source": {
     "type": "string"
    },
    "videoId": {
     "type": "string"
    },
    "segments": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "text"
      ],
      "properties": {
       "text": {
        "type": "string"
       },
       "endMs": {
        "type": "number"
       },
       "startMs": {
        "type": "number"
       },
       "durationMs": {
        "type": "number"
       }
      }
     }
    },
    "fetchedAt": {
     "type": "string"
    },
    "transcript": {
     "type": "string"
    },
    "serviceName": {
     "type": "string"
    },
    "languageCode": {
     "type": "string"
    },
    "languageName": {
     "type": "string"
    },
    "segmentCount": {
     "type": "number"
    },
    "serviceVersion": {
     "type": "string"
    },
    "transcriptHash": {
     "type": "string"
    },
    "extractorVersion": {
     "type": "string"
    }
   }
  },
  "status": {
   "enum": [
    "accepted",
    "rejected",
    "running",
    "error"
   ],
   "type": "string"
  },
  "taskId": {
   "type": "string"
  },
  "settlement": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  },
  "x402Settlement": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  },
  "validationReceipt": {
   "type": [
    "object",
    "null"
   ],
   "additionalProperties": true
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gateway-d402-xyz-youtube-video-transcript-extractor-9e55533b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gateway.d402.xyz](https://www.zero.xyz/host/gateway.d402.xyz/llms.txt)
