Social platforms

List a YouTube video's caption tracks · YouTube API

GET/youtube/videos/{video_id}/captions
$min $0.001

Return the caption/subtitle tracks available for a YouTube video, by video ID — language, a timed-text url per track, and the languages YouTube can auto-translate into. Useful for transcript pipelines and accessibility tooling.

Using ChatGPT, Claude Code or another client? See the setup steps

Request
curl https://api.unifapi.com/youtube/videos/{video_id}/captions \
  -H "Authorization: Bearer $UNIFAPI_KEY"

Parameters

video_idpathrequired
Overview

This operation is part of the YouTube API in the social platforms category. It uses the same Bearer token, request tracing, error model, and billing envelope as every UnifAPI endpoint, so agents can switch between platforms without custom per-vendor glue code.

Use it when a workflow needs YouTube public data alongside other social networks, but should still keep one API key, one account balance, and one predictable JSON contract.

Common agent workflows

  • Fetch canonical public YouTube content for summarization, ranking, monitoring, or enrichment.
  • Attach engagement, author, media, and source metadata to an agent workflow.
  • Give an AI agent a stable YouTube data source without building a per-platform integration.
  • Normalize YouTube responses into the same UnifAPI envelope used across the catalog.
Response shape

Unified envelope, platform-native fields

  • List-style responses return `data` as an array of top-level records plus optional `pagination` for continuation tokens or cursors.
  • The `billing.records_charged` field reports the charged billable-record quantity for the successful response.
  • If the workspace balance cannot cover every result, the response can be truncated and `billing.truncated_due_to_balance` tells the caller why.

Response status codes

200400401402404429500502503

Billing

This operation charges 1 credit per billable record, with a 1 credit ($0.001) operation minimum. Public responses include billing metadata with credits charged, records charged, and remaining workspace balance. Incorrect Credit deductions caused by platform failures can be restored as billing corrections.

Errors and retries

Authentication, validation, rate-limit, not-found, and provider errors use the unified UnifAPI error format. Agents should log `request_id`, retry only retryable failures, and treat invalid API keys, disabled keys, and expired keys as the same public `unauthorized` error type.

Response fields

Fields in the data object

A successful List a YouTube video's caption tracks call returns one data object with these fields.

video_idstring
tracksobject[]
translation_languagesobject[]
tracks[].language_namestring
tracks[].language_codestring
tracks[].urlstring
Timed-text url for the caption track (time-limited).
tracks[].is_translatableboolean
translation_languages[].language_codestring
translation_languages[].language_namestring
Related endpoints

More YouTube operations

Combine endpoints from the same platform, then join the results with other UnifAPI categories without changing authentication or response parsing.

GET/youtube/videos/{video_id}

Get a YouTube video by id

Return a single YouTube video's details by its video ID — title, description, channel, duration, category, publish time, and view and like counts. Useful for hydrating a known video or checking its current engagement.

GET/youtube/videos/{video_id}/comments

List comments on a YouTube video

Return the comments on a YouTube video, by video ID, as a cursor-paginated list — author, text, like and reply counts. Sort by top (default) or newest. Useful for audience sentiment, FAQ mining, and creator feedback analysis.

GET/youtube/videos/{video_id}/related

List YouTube videos related to a given video

Return the videos YouTube recommends as related to a given video, by video ID. Useful for mapping a topic's surrounding content and discovering adjacent creators.

GET/youtube/videos/{video_id}/transcript

Get a YouTube video's transcript

Return the transcript text for a YouTube video, by video ID, as ordered timestamped segments plus a concatenated plain-text field. Picks the caption track for the requested `lang` (default English, then the first available track), fetches its timed-text and parses it server-side. Returns 404 when the video has no captions.

GET/youtube/channels/{channel_id}/community

List a YouTube channel's community posts

Return a YouTube channel's community-tab posts, by its `UC…` channel ID, as a cursor-paginated list — text, like and reply counts, and attachment kind. Useful for tracking creator announcements and audience engagement outside of videos.

GET/youtube/channels/{channel_id}/videos

List videos uploaded by a YouTube channel

Return the videos uploaded by a YouTube channel, by its `UC…` channel ID, as a cursor-paginated list. Useful for profiling a channel's catalog, monitoring uploads, or building an archive.