Get YouTube video transcript

Get the transcript for a YouTube video by URL.

GET/v1/youtube/videos/transcript
x-api-keystringheader

API key (`sfk_...`)

Parameters
3
urlstringrequiredquery

Link to the YouTube video whose transcript should be returned.

min 1 chars · max 4096 chars

languagestringoptionalquery

Optional language code to prefer when multiple transcripts exist: a two- or three-letter code (`en`, `es`), optionally with a region or script (`en-US`, `pt-BR`, `zh-Hans`). See `availableLanguages` for the codes a video offers.

pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$

originalAudiobooleanoptionalquery

When `true`, only return captions in the video's original spoken language, and ignore `language`. If the original language can't be identified or has no captions, `transcript` is `null`. Default: `false`.

Response fields
24

Endpoint-specific response payload.

datalookupStatus
string

Outcome of the transcript lookup.

one of: found, not_found, lookup_failed

Video identity when the lookup resolved.

datavideoid
string

YouTube video id.

min 1 chars

datavideourl
string

Canonical public URL for the video.

min 1 chars

datavideotype
stringnullable

`video` for a regular video, `short` for a YouTube Short. `null` when unknown.

one of: video, short, null

Transcript content when available for the resolved video. `null` when the video has no readable transcript; such lookups are free.

Timed transcript segments.

datatranscriptsegments[]text
string

Transcript segment text.

datatranscriptsegments[]startMs
integer

Segment start offset in milliseconds.

≥ 0

datatranscriptsegments[]endMs
integer

Segment end offset in milliseconds.

≥ 0

datatranscriptplainText
string

Full transcript text, typically derived from captions.

datatranscriptlanguage
string

Human-readable transcript language label when reported by the lookup.

datatranscriptlanguageCode
stringnullable

Language code of the caption track that was returned, as listed in `availableLanguages`. `null` when it can't be determined reliably.

datatranscriptautoGenerated
booleannullable

`true` when the returned captions were generated automatically by YouTube, `false` when they were uploaded by the creator. `null` when it can't be determined reliably.

Caption tracks the video offers, including when `transcript` is `null`. Empty when the video has none or the lookup did not resolve.

dataavailableLanguages[]code
string

Language code of the caption track. Pass it as `language` to request this track.

min 1 chars

dataavailableLanguages[]name
stringnullable

Human-readable language name, for example `English` or `Portuguese (Brazil)`. `null` when not reported.

dataavailableLanguages[]autoGenerated
boolean

`true` for captions generated automatically by YouTube, `false` for captions uploaded by the creator.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

metacached
booleanoptional

True when served from shared response cache. Credits still apply (full endpoint price); Age header may be present.

Code example

curl "https://api.socialfetch.dev/v1/youtube/videos/transcript?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Transcript lookup result.