Skip to main content

Overview

Use YouTube Transcript when you need transcript text from a public video. The endpoint returns the transcript plus available video metadata.

Endpoint

POST /api/v2/youtube_transcript

Quickstart

from llmlayer import LLMLayerClient

client = LLMLayerClient(api_key="YOUR_LLMLAYER_API_KEY")

response = client.get_youtube_transcript(
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    language="en",
)

print(response.title)
print(response.transcript)

Request Parameters

ParameterTypeRequiredDescription
urlstringYesYouTube video URL
languagestring | nullNoPreferred transcript language, for example en, es, or fr
Supported URL forms include:
  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID

Response

{
  "transcript": "Transcript text...",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Video title",
  "description": "Video description",
  "author": "Channel name",
  "views": 123456,
  "likes": 1234,
  "date": "2026-01-01",
  "language": "en",
  "cost": 0.003
}
FieldTypeDescription
transcriptstringTranscript text
urlstringVideo URL
titlestring | nullVideo title
descriptionstring | nullVideo description
authorstring | nullChannel or author
viewsinteger | nullView count when available
likesinteger | nullLike count when available
datestring | nullPublish date when available
languagestring | nullTranscript language
costnumber | nullCost in USD

Pricing

YouTube Transcript costs $0.003 per request.

Limitations

  • The video must be public.
  • The video must have captions/transcripts available.
  • Requested languages may not be available on every video.
  • Live streams may not have transcripts.

Errors

StatusMeaning
400Invalid YouTube URL
401Missing or invalid LLMLayer API key
500Transcript extraction failed
See Errors & Refunds for the shared error format.