APIs / Social media / YouTube

1 credit per call15 endpointsChecked working 6 Dec 2026

YouTube API

YouTube API for video search, video details, transcripts, comments, channels, playlists and trending as JSON. 1 credit per call.

YouTube
GET/v1/youtube/search?query=programming+tutorial
curl "https://api.perceptlayer.com/v1/youtube/search?query=programming+tutorial" \
  -H "X-API-Key: $API_KEY"
cURL1 credit per successful call
Run this call below or from your dashboard to see a live response.

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/youtube/search?query=programming+tutorial" \
  -H "X-API-Key: $API_KEY"

YouTube · 15 endpoints

Endpoints

Every endpoint takes the same key. Open one for its parameters, the fields it returns and an example request.

Note
Endpoints marked “Needs terms” return personal or social data. They work once you accept the restricted-endpoint terms in your dashboard.
EndpointRequired parametersReturnsCost
GET/v1/youtube/channel
none+2 optionalNeeds terms
idnamedescriptionthumbnailbannersubscriberCount+5 more
1 credit
GET/v1/youtube/channel-community
none+3 optionalNeeds terms
postspaginationchannelId
1 credit
GET/v1/youtube/channel-playlists
none+2 optionalNeeds terms
channelIdpagination
1 credit
GET/v1/youtube/channel-videos
none+7 optionalNeeds terms
channelIdvideospagination
1 credit
GET/v1/youtube/chapters
none+2 optionalNeeds terms
videoIdhasChapters
1 credit
GET/v1/youtube/comments
video_id+1 optionalNeeds terms
videoIdvideoTitlecommentspaginationmetadata
1 credit
GET/v1/youtube/locales
noneNeeds terms
hlgl
1 credit
GET/v1/youtube/playlist
playlist_id+1 optionalNeeds terms
titledescriptionthumbnailvideoCountviewCountlastUpdated+4 more
1 credit
GET/v1/youtube/related
video_id+1 optionalNeeds terms
idtitlethumbnailpublishedTimechannelisLive
1 credit
GET/v1/youtube/search
none+12 optionalNeeds terms
typeidtitledescriptionthumbnailduration+12 more
1 credit
GET/v1/youtube/suggestions
query+2 optionalNeeds terms
localesuggestions
1 credit
GET/v1/youtube/transcript
none+7 optionalNeeds terms
videoIdlanguagelanguageNamesourceLanguagesourceLanguageNameisAutoGenerated+5 more
1 credit
GET/v1/youtube/transcript-by-video-id
videoId+6 optionalNeeds terms
JSON1 credit
GET/v1/youtube/trending
none+4 optionalNeeds terms
resultspaginationsuggestionTypelocaleupstream_sourcetype+1 more
1 credit
GET/v1/youtube/video
none+2 optionalNeeds terms
idvideoIdtitledescriptionthumbnailduration+35 more
1 credit

Overview

About the YouTube API

What you can get

The YouTube API returns public YouTube data as JSON through 15 endpoints. These are restricted endpoints: the restricted-endpoint terms apply, and they don't permit collecting personal data without a lawful basis or using it to contact people.

  • Search: search for a query, with type (video, channel, playlist, movie or all), order (date, rating, relevance or viewCount), videoDuration (short, medium or long), publishedAfter and publishedBefore. suggestions returns search suggestions for a query.
  • Videos: video, chapters, related and comments by video_id.
  • Transcripts: transcript by video_id, with an optional language.
  • Channels: a channel, its channel-videos (sort by newest, popular or oldest, and type videos, shorts, live or podcasts), its channel-playlists and channel-community posts, all by channel_id.
  • Playlists: a playlist by playlist_id.
  • Trending: trending by type (now, music, gaming or movies) and gl.

Several list endpoints also take limit and continuation. locales takes no parameters.

How a call works

Most calls need one ID. GET /v1/youtube/transcript?video_id=... returns a video's transcript; GET /v1/youtube/channel-videos?channel_id=...&sort=newest lists a channel's latest videos. Every successful call costs 1 credit; failed calls cost nothing.

Social mediaJSONRESTMCPSome endpoints need terms

More social media APIs

Use cases

Summarise or search video transcripts with an AI agent

Use the YouTube API to summarise or search video transcripts with an AI agent

Track what's trending by country and category

Use the YouTube API to track what's trending by country and category

Monitor a set of channels for new uploads

Use the YouTube API to monitor a set of channels for new uploads

Research how often a topic appears in video search over time

Use the YouTube API to research how often a topic appears in video search over time

FAQ

Questions

Is there a YouTube API quota?

This API has no quota of its own beyond credits: each successful call costs 1 credit from your balance, and your account's rate limit applies.

How much does the YouTube API cost?

Each successful call costs one credit, on every endpoint. New accounts get free credits to start, and credit packs bring the price down as you scale.

What format are responses in?

Every endpoint returns JSON, with no HTML parsing on your side.

Is this the official YouTube API?

No. Perceptlayer is an independent service and is not affiliated with YouTube. It returns YouTube data as JSON with a Perceptlayer key, so there is no YouTube developer account, app review or partner approval to get first. It only reads data: if YouTube has an official API and you need to act on your own YouTube account, such as posting, managing orders or reading private data, use that one.

Should I build a YouTube scraper instead?

You can, but a YouTube scraper is code you maintain: page changes break it, requests get blocked, and YouTube's terms govern how you collect data. The YouTube API gives you 15 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first. Some of these endpoints return social or personal data and need the restricted-endpoint terms; collect only what you have a lawful basis for.

Try the YouTube API with 100 free credits

No credit card. Failed calls are never billed.