YouTube API
26 endpoints for channels, videos and transcripts.
Every YouTube endpoint, by group. Each is a GET under /v1/youtube.
Quick Reference
| Property | Value |
|---|---|
| Base path | /v1/youtube |
| Endpoints | 26 |
| Credits | See Below |
| Guide | YouTube |
Accounts
GETProfile
/v1/youtube/profileA channel with its subscribers, videos and views.1 creditGETProfile Community/v1/youtube/profile/communityA channel's community posts, 10 a page.1 creditGETProfile Lives/v1/youtube/profile/livesA channel's live streams, on now and past, 30 a page.1 creditGETProfile Playlists/v1/youtube/profile/playlistsA channel's playlists, 30 a page.1 creditGETProfile Podcasts/v1/youtube/profile/podcastsA channel's podcasts.1 creditGETProfile Posts/v1/youtube/profile/postsA channel's videos, 30 a page.1 creditGETProfile Search/v1/youtube/profile/searchA search within one channel's videos, about 30 a page.1 creditGETProfile Shorts/v1/youtube/profile/shortsA channel's Shorts, about 48 a page.1 creditPosts
GETCommunity
/v1/youtube/communityOne community post with its likes and images.1 creditGETPlaylist/v1/youtube/playlistA playlist with its owner and video count.1 creditGETPlaylist Posts/v1/youtube/playlist/postsA playlist's videos in order, 100 a page.1 creditGETPost/v1/youtube/postOne video or Short with its views, likes and chapters.1 creditGETPost Comments/v1/youtube/post/commentsA video's comments, top or newest first, about 20 a page.1 creditGETPost Comment Replies/v1/youtube/post/comment/repliesA comment's replies, 10 a page.1 creditGETPost Related/v1/youtube/post/relatedThe videos YouTube suggests beside one, about 20 a page.1 creditGETPost Transcript/v1/youtube/post/transcriptA video's captions as text.5 creditsDiscovery
GETHashtag
/v1/youtube/hashtagA hashtag with its video and channel counts.1 creditGETHashtag Posts/v1/youtube/hashtag/postsA hashtag's videos or Shorts, about 36 a page.1 creditGETSearch/v1/youtube/searchVideos matching a query, about 20 a page.1 creditGETSearch Channels/v1/youtube/search/channelsChannels matching a query, about 20 a page.1 creditGETSearch Playlists/v1/youtube/search/playlistsPlaylists matching a query, about 20 a page.1 creditGETSearch Suggestions/v1/youtube/search/suggestionsWhat the search box suggests for a few letters.1 creditGETTrending/v1/youtube/trendingWhat is trending in a country, about 20 videos.1 creditBatch
GETBatch Posts
/v1/youtube/batch/postsUp to 50 videos at once, by their ids.1 creditGETBatch Profiles/v1/youtube/batch/profilesUp to 20 channels at once, by their ids or handles.1 creditGETBatch Transcripts/v1/youtube/batch/transcriptsUp to 20 videos' captions at once, by their ids.5 creditsExample Request
Every YouTube endpoint is called this way: its path, and what to read as query parameters.
import { SocialAPI } from "@socialapihq/sdk";
const client = new SocialAPI({ apiKey: process.env.SOCIALAPI_API_KEY });
const { data } = await client.youtube.profile({ handle: "LinusTechTips" });{
"data": {
"id": "UCXuqSBlHAE6Xw-yeJA0Tunw",
"username": "LinusTechTips",
"displayName": "Linus Tech Tips",
"bio": "Linus Tech Tips is a passionate team of \"professionally curious\" experts in consumer technology and video production who aim to educate and entertain.\n\nSponsorship Inquiries: partnerships@linusmediagroup.com",
"avatarUrl": "https://yt3.googleusercontent.com/gnvYLhXy8FAlPXZ2RTrkrgj-5kyt0vdE2FUGVOiKGdEZIa-wN5A-7nwZBlWJLzUMmoh1NWAU=s160-c-k-c0x00ffffff-no-rj",
"url": "https://www.youtube.com/@LinusTechTips",
"verified": true,
"private": false,
"followers": 16900000,
"following": null,
"likes": null,
"posts": 8011,
"externalUrl": "https://www.lttstore.com/",
"createdAt": "2008-11-24T00:00:00.000Z",
"ext": {
"views": 10045352646,
"country": "Canada",
"bannerUrl": "https://yt3.googleusercontent.com/U_7GWetO6k4sq3pAkbFEIIWzZLKcIJlGJqNz6NQAhgqF6DVD5pllwWF6trSUWEIRn4MkhNlhy9Y=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"links": [
{
"title": "lttstore.com",
"url": "https://www.lttstore.com/"
},
{
"title": "Floatplane",
"url": "https://www.floatplane.com/ltt"
},
{
"title": "Labs",
"url": "https://www.lttlabs.com/"
}
],
"subscribersText": "16.9M subscribers"
}
}
}Errors
A call that fails costs nothing. See Errors for every code.