API документация

YouTube Data API

Powerful YouTube API for video details, streaming data, captions, comments, channel content, search, trending videos, hashtags and discovery tools.

YouTube Data & Intelligence API Documentation

The YouTube Data & Intelligence API provides simple REST endpoints for accessing structured public YouTube data. You can use it to retrieve video details, channel content, Shorts, livestreams, comments, captions, playlists, trending feeds, hashtag results, player data and streaming-related information.

This API is designed for developers building analytics dashboards, influencer discovery tools, media monitoring platforms, video SEO software, content research tools, automation workflows and SaaS products that need reliable YouTube data in JSON format.


Base URL

https://apibara.tech/api/v1/youtube

Authentication

Every request must include your API key. The exact header depends on your account/API access setup.

X-API-Key: YOUR_API_KEY

Example request:

GET https://apibara.tech/api/v1/youtube/video/details?input=dQw4w9WgXcQ

Response Format

All endpoints return JSON responses.

Success response example

{
  "ok": true,
  "data": {
    "example": "Response data depends on the selected endpoint."
  }
}

Error response example

{
  "ok": false,
  "error": "input is required",
  "code": 422
}

Common Parameters

input

The main input value used by most endpoints. Depending on the endpoint, this can be a YouTube video URL, video ID, channel URL, channel handle, channel ID, playlist URL, community post URL or community post ID.

Examples:

input=dQw4w9WgXcQ
input=https://www.youtube.com/watch?v=dQw4w9WgXcQ
input=@MrBeast
input=https://www.youtube.com/@MrBeast

continuation

A pagination token returned by endpoints that support loading more results. Use the returned continuation token with the same endpoint to load the next page.

Pagination flow:

  1. Send the first request without continuation.
  2. Read the continuation value from the JSON response.
  3. Send another request to the same endpoint with that token.
  4. Repeat until no continuation token is returned.
GET /discovery/search?q=music
GET /discovery/search?continuation=NEXT_PAGE_TOKEN

hl

Language code used for localized response text.

hl=en
hl=uk
hl=de
hl=fr

gl

Two-letter country code used for regional YouTube context.

gl=US
gl=UA
gl=DE
gl=GB

Example with localization:

GET /video/details?input=dQw4w9WgXcQ&hl=uk&gl=UA

Discovery Endpoints

Discovery endpoints help you search YouTube, resolve YouTube URLs, access trending content and retrieve hashtag-based feeds.

GET /discovery/resolve

Resolves a supported YouTube input into a normalized target.

Parameters

Parameter Required Description
input Yes Video URL, video ID, channel URL, handle, playlist URL, post URL or other supported YouTube input.

Example

GET /discovery/resolve?input=https://www.youtube.com/watch?v=dQw4w9WgXcQ

GET /discovery/search

Searches YouTube content and returns structured results.

Parameters

Parameter Required Description
q Required for first page Search query.
result_type No Filter result type. Supported values: all, video, channel, playlist.
continuation No Pagination token for the next page.
hl No Language code.
gl No Country code.

Examples

GET /discovery/search?q=lofi&result_type=video
GET /discovery/search?continuation=NEXT_PAGE_TOKEN

GET /discovery/trending

Returns YouTube trending content for a selected country.

Parameters

Parameter Required Description
country No Two-letter country code, for example US, UA, DE, GB.
continuation No Pagination token for the next page.
hl No Language code.
gl No Country code.

Examples

GET /discovery/trending?country=US
GET /discovery/trending?continuation=NEXT_PAGE_TOKEN

GET /discovery/hashtag

Returns videos from a YouTube hashtag feed.

Parameters

Parameter Required Description
tag Required for first page Hashtag name with or without the # symbol.
continuation No Pagination token for the next page.
hl No Language code.
gl No Country code.

Examples

GET /discovery/hashtag?tag=shorts
GET /discovery/hashtag?continuation=NEXT_PAGE_TOKEN

Video Endpoints

Video endpoints return video metadata, captions, player data, playability status and streaming-related information.

GET /video/details

Returns detailed metadata for a YouTube video.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/details?input=dQw4w9WgXcQ&hl=en&gl=US

GET /video/streaming

Returns streaming data and available media format information for a YouTube video.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/streaming?input=dQw4w9WgXcQ

GET /video/streaming-links

Returns direct media links when available.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/streaming-links?input=https://www.youtube.com/watch?v=dQw4w9WgXcQ

GET /video/captions

Returns available captions and subtitle tracks for a YouTube video.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/captions?input=dQw4w9WgXcQ

GET /video/playability

Checks whether a YouTube video is playable and returns availability or restriction-related data.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/playability?input=dQw4w9WgXcQ

GET /video/player

Returns raw YouTube player response data for a video.

Parameters

Parameter Required Description
input Yes YouTube video URL or video ID.
hl No Language code.
gl No Country code.

Example

GET /video/player?input=dQw4w9WgXcQ

Comments Endpoints

Comments endpoints return public comments for videos and supported community posts. They also support loading nested replies.

GET /comments

Returns comments for a YouTube video or supported community post.

Parameters

Parameter Required Description
input Required for first page Video URL, video ID, community post URL or post ID.
continuation No Pagination token for loading the next page.
sort_by No Supported values: top, newest.
hl No Language code.
gl No Country code.

Examples

GET /comments?input=dQw4w9WgXcQ&sort_by=top
GET /comments?continuation=NEXT_PAGE_TOKEN

GET /comments/replies

Returns replies for a specific parent comment.

Parameters

Parameter Required Description
continuation Yes Replies token returned from the parent comments response.
video_id No Video ID for additional context.
hl No Language code.
gl No Country code.

Example

GET /comments/replies?continuation=REPLIES_TOKEN

Channel Endpoints

Channel endpoints return channel home data, videos, Shorts, livestreams, community posts, podcasts, playlists and channel search results.

GET /channel

Returns main public channel data.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle, channel ID or other supported channel input.

Example

GET /channel?input=@MrBeast

GET /channel/videos

Returns public videos from a YouTube channel.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
continuation No Pagination token for loading the next page.
sort_by No Supported values: latest, oldest, popular.

Examples

GET /channel/videos?input=@MrBeast&sort_by=latest
GET /channel/videos?input=@MrBeast&continuation=NEXT_PAGE_TOKEN

GET /channel/shorts

Returns public YouTube Shorts from a channel.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
continuation No Pagination token for loading the next page.

Example

GET /channel/shorts?input=@MrBeast

GET /channel/livestreams

Returns public livestreams, upcoming live videos and live-related channel content.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
continuation No Pagination token for loading the next page.

Example

GET /channel/livestreams?input=@MrBeast

GET /channel/posts

Returns public YouTube community posts from a channel.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
continuation No Pagination token for loading the next page.

Example

GET /channel/posts?input=@MrBeast

GET /channel/podcasts

Returns podcast-related channel content when available.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.

Example

GET /channel/podcasts?input=@MrBeast

GET /channel/playlists

Returns public playlists from a YouTube channel.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
continuation No Pagination token for loading the next page.

Example

GET /channel/playlists?input=@MrBeast

GET /channel/search

Searches public content inside a specific YouTube channel.

Parameters

Parameter Required Description
input Yes Channel URL, channel handle or channel ID.
query Yes Search phrase inside the channel.

Example

GET /channel/search?input=@MrBeast&query=challenge

Pagination Guide

Some endpoints return a continuation token when more results are available. To load the next page, send this token back to the same endpoint.

Endpoints that support pagination

  • /discovery/search
  • /discovery/trending
  • /discovery/hashtag
  • /comments
  • /comments/replies
  • /channel/videos
  • /channel/shorts
  • /channel/livestreams
  • /channel/posts
  • /channel/playlists

Pagination example

GET /channel/videos?input=@MrBeast
GET /channel/videos?input=@MrBeast&continuation=NEXT_PAGE_TOKEN

Important: use the continuation token with the same endpoint that returned it.


Localization Guide

Use hl and gl when you need localized or region-aware YouTube results.

  • hl controls response language.
  • gl controls regional YouTube context.

Examples

GET /video/details?input=dQw4w9WgXcQ&hl=en&gl=US
GET /video/details?input=dQw4w9WgXcQ&hl=uk&gl=UA
GET /discovery/trending?country=DE&hl=de&gl=DE

Common Use Cases

  • YouTube analytics dashboards
  • Influencer discovery platforms
  • Video SEO tools
  • Media monitoring systems
  • Social listening platforms
  • Comment analysis tools
  • Caption and subtitle integrations
  • Channel tracking systems
  • Playlist monitoring tools
  • Research and data collection workflows
  • SaaS data enrichment
  • Backend content pipelines