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.
curl "https://api.perceptlayer.com/v1/youtube/search?query=programming+tutorial" \
-H "X-API-Key: $API_KEY"Playground
Run this API
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.
| Endpoint | Required parameters | Returns | Cost |
|---|---|---|---|
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 | JSON | 1 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:
searchfor aquery, withtype(video, channel, playlist, movie or all),order(date, rating, relevance or viewCount),videoDuration(short, medium or long),publishedAfterandpublishedBefore.suggestionsreturns search suggestions for aquery. - Videos:
video,chapters,relatedandcommentsbyvideo_id. - Transcripts:
transcriptbyvideo_id, with an optionallanguage. - Channels: a
channel, itschannel-videos(sortby newest, popular or oldest, andtypevideos, shorts, live or podcasts), itschannel-playlistsandchannel-communityposts, all bychannel_id. - Playlists: a
playlistbyplaylist_id. - Trending:
trendingbytype(now, music, gaming or movies) andgl.
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.
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 agentTrack what's trending by country and category
Use the YouTube API to track what's trending by country and categoryMonitor a set of channels for new uploads
Use the YouTube API to monitor a set of channels for new uploadsResearch 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 timeFAQ
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.