Skip to Content

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

PropertyValue
Endpoints26
Channels byhandle, channelId or url
Videos byurl or id
Videos a page30
Comments a pageAbout 20
TranscriptsYes, 5 credits
CountsViews and likes; subscribers rounded

Channels

EndpointReturnsCredits
profileA channel with its subscribers, videos and views.1
profile/communityA channel's community posts, 10 a page.1
profile/livesA channel's live streams, on now and past, 30 a page.1
profile/playlistsA channel's playlists, 30 a page.1
profile/podcastsA channel's podcasts.1
profile/postsA channel's videos, 30 a page.1
profile/searchA search within one channel's videos, about 30 a page.1
profile/shortsA 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" });
Response
{
  "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 followers are its subscribers, rounded as YouTube shows them (16.9M).
  • Its posts is its video count, and ext.views its total views, both exact.
  • Its ext also has its country, banner and links.

Channel Tabs

  • Videos, Shorts and live streams take sort: latest (the default), popular or oldest.
  • 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

EndpointReturnsCredits
communityOne community post with its likes and images.1
playlistA playlist with its owner and video count.1
playlist/postsA playlist's videos in order, 100 a page.1
postOne video or Short with its views, likes and chapters.1
post/commentsA video's comments, top or newest first, about 20 a page.1
post/comment/repliesA comment's replies, 10 a page.1
post/relatedThe videos YouTube suggests beside one, about 20 a page.1
post/transcriptA video's captions as text.5

Video Fields

  • The text is the description, and ext.title the title.
  • The stats have views and likes; comments are rounded as YouTube shows them.
  • Its ext has its length, category, tags, chapters and the songs it credits.
  • A Short's ext.kind is short, a live stream's live, a community post's community.

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

EndpointReturnsCredits
hashtagA hashtag with its video and channel counts.1
hashtag/postsA hashtag's videos or Shorts, about 36 a page.1
searchVideos matching a query, about 20 a page.1
search/channelsChannels matching a query, about 20 a page.1
search/playlistsPlaylists matching a query, about 20 a page.1
search/suggestionsWhat the search box suggests for a few letters.1
trendingWhat is trending in a country, about 20 videos.1
  • Search takes type (videos, shorts, live), uploaded, duration, features and sort.
  • Trending is YouTube's chart of a country's trending videos, by country.
  • A hashtag's videos take shorts for its Shorts alone.

Batch

EndpointReturnsCredits
batch/postsUp to 50 videos at once, by their ids.1
batch/profilesUp to 20 channels at once, by their ids or handles.1
batch/transcriptsUp 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.