---
title: "YouTube Transcript"
method: POST
path: "/social/youtube/transcript"
tags: ["Social"]
---

# YouTube Transcript

`POST /social/youtube/transcript`

## Request

- Base URL: `https://api.weblens.dev`
- URL: `https://api.weblens.dev/social/youtube/transcript`
- Auth: API key in header `Payment-Signature`

Full transcript of any YouTube video with timestamps. Accepts a video ID or any YouTube URL. Price: $0.03.

## Request body

- object
  - `videoId` string, required: YouTube video ID (e.g. dQw4w9WgXcQ) or full video URL
  - `lang` string: Transcript language code (default: video default)

## Response `200`

Full video transcript with timestamps.

- object
  - `videoId` string
  - `language` string: The transcript language you requested with lang, when given
  - `segments` object[]: Transcript segments with startMs, startTime, text
    - `startMs` integer
    - `startTime` string
    - `text` string
  - `fullText` string: All segments joined
  - `fetchedAt` string
  - `requestId` string

## Other responses

- `400`: The body failed validation
- `402`: Payment required — x402 v2 protocol. Parse the PAYMENT-REQUIRED response header (base64-encoded JSON), sign the payment with your wallet, then retry the request with the Payment-Signature request header.
- `404`: No transcript available for this video

---

[API](https://skmtc.dev/weblens/apis/weblens-api.md) · [All operations](https://skmtc.dev/weblens/apis/weblens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/weblens/apis/weblens-api/revisions/63a7e81b6921?raw)
