Platforms
YouTube
Read YouTube channels and their tabs, videos with their comments and captions, playlists, search and trending.
Read channels with their videos, Shorts, live streams, playlists and community posts, a video with its comments and captions, and what YouTube shows by search, hashtag and trend.
Quick Reference
| Property | Value |
|---|---|
| Endpoints | 26 |
| Channels by | handle, channelId or url |
| Videos by | url or id |
| Videos a page | 30 |
| Comments a page | About 20 |
| Transcripts | Yes, 5 credits |
| Counts | Views and likes; subscribers rounded |
Channels
| Endpoint | Returns | Credits |
|---|---|---|
profile | A channel with its subscribers, videos and views. | 1 |
profile/community | A channel's community posts, 10 a page. | 1 |
profile/lives | A channel's live streams, on now and past, 30 a page. | 1 |
profile/playlists | A channel's playlists, 30 a page. | 1 |
profile/podcasts | A channel's podcasts. | 1 |
profile/posts | A channel's videos, 30 a page. | 1 |
profile/search | A search within one channel's videos, about 30 a page. | 1 |
profile/shorts | A channel's Shorts, about 48 a page. | 1 |
Read a Channel
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"
}
}
}- A channel's
followersare its subscribers, rounded as YouTube shows them (16.9M). - Its
postsis its video count, andext.viewsits total views, both exact. - Its
extalso has its country, banner and links.
Channel Tabs
- Videos, Shorts and live streams take
sort:latest(the default),popularoroldest. - A list gives when a video was published as YouTube writes it, in
ext.publishedText. - Members-only videos have
ext.membersOnly, and no views. - Podcasts are playlists of their episodes.
Videos
| Endpoint | Returns | Credits |
|---|---|---|
community | One community post with its likes and images. | 1 |
playlist | A playlist with its owner and video count. | 1 |
playlist/posts | A playlist's videos in order, 100 a page. | 1 |
post | One video or Short with its views, likes and chapters. | 1 |
post/comments | A video's comments, top or newest first, about 20 a page. | 1 |
post/comment/replies | A comment's replies, 10 a page. | 1 |
post/related | The videos YouTube suggests beside one, about 20 a page. | 1 |
post/transcript | A video's captions as text. | 5 |
Video Fields
- The
textis the description, andext.titlethe title. - The
statshave views and likes; comments are rounded as YouTube shows them. - Its
exthas its length, category, tags, chapters and the songs it credits. - A Short's
ext.kindisshort, a live stream'slive, a community post'scommunity.
Comments
Comments take sort: top (the default) or newest. A comment with replies has ext.repliesToken, which post/comment/replies takes as token, 10 a page.
Transcripts
A transcript is the uploader's captions in the language you ask for, else YouTube's own in the language spoken. Its languages lists every language the video has, and generated says when YouTube wrote it.
Discovery
| Endpoint | Returns | Credits |
|---|---|---|
hashtag | A hashtag with its video and channel counts. | 1 |
hashtag/posts | A hashtag's videos or Shorts, about 36 a page. | 1 |
search | Videos matching a query, about 20 a page. | 1 |
search/channels | Channels matching a query, about 20 a page. | 1 |
search/playlists | Playlists matching a query, about 20 a page. | 1 |
search/suggestions | What the search box suggests for a few letters. | 1 |
trending | What is trending in a country, about 20 videos. | 1 |
- Search takes
type(videos,shorts,live),uploaded,duration,featuresandsort. - Trending is YouTube's chart of a country's trending videos, by
country. - A hashtag's videos take
shortsfor its Shorts alone.
Batch
| Endpoint | Returns | Credits |
|---|---|---|
batch/posts | Up to 50 videos at once, by their ids. | 1 |
batch/profiles | Up to 20 channels at once, by their ids or handles. | 1 |
batch/transcripts | Up to 20 videos' captions at once, by their ids. | 5 |
- Each item is read as its own endpoint answers it, and one served from the cache is free.
- An item not found is left out of the answer, and costs nothing.