Social Fetch
YouTube

Get YouTube video transcript

Returns structured captions for a YouTube video when available. Pass `url` as a standard watch link (or equivalent). Optional `language` requests a preferred caption language when multiple tracks exist.

Operation

GET/v1/youtube/videos/transcript
Cost: 1 credit

Headers

x-api-keystringrequired(header)

API key (`sfk_...`)

Parameters

urlstringrequired(query)

Link to the YouTube video whose transcript should be returned.

min 1 chars · max 4096 chars

languagestring(query)

Optional ISO 639-1 language code (two letters) to prefer when multiple transcripts exist.

min 2 chars · max 2 chars

Response fields

data
objectrequired

Endpoint-specific response payload.

datalookupStatus
stringrequired

Outcome of the transcript lookup: resolved video, not found, or lookup could not be completed.

one of: found, not_found, lookup_failed

datavideo
objectrequirednullable

Video identity when the lookup resolved.

datavideoid
stringrequired

YouTube video id.

min 1 chars

datavideourl
stringrequired

Canonical public URL for the video.

min 1 chars

datatranscript
objectrequirednullable

Transcript content when available for the resolved video.

datatranscriptsegments
arrayrequired

Timed transcript segments.

datatranscriptsegments[]text
stringrequired

Transcript segment text.

datatranscriptsegments[]startMs
integerrequired

Segment start offset in milliseconds.

≥ 0

datatranscriptsegments[]endMs
integerrequired

Segment end offset in milliseconds.

≥ 0

datatranscriptplainText
stringrequired

Full transcript text, typically derived from captions.

datatranscriptlanguage
stringrequired

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

meta
objectrequired

Metadata describing the request and billing outcome.

metarequestId
stringrequired

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integerrequired

Credits charged for this request.

≥ 0

metaversion
stringrequired

Public API version that served the response.

one of: v1

Code example

Responses

Transcript lookup result. Inspect `data.lookupStatus` for found, not found, or lookup_failed.

Error codes

bad_requestinsufficient_creditsinternal_errorlookup_failedtemporarily_unavailableunauthorized

On this page