API
YouTube API
The TrueScrape YouTube API exposes 17 public endpoints covering Channel details, Channel videos, Channel community posts and Channel live streams. Every call is a GET against public, logged-out pages and returns the same unified schema as every other platform here. Calls cost 1 credit each. A cache hit is free, and a failed or empty response is never charged.
Channel details
curl "https://api.truescrape.com/v1/youtube/channel?handle=%40MrBeast" \
-H "x-api-key: $KEY"What YouTube exposes
- A YouTube video or Short returns the exact like count where YouTube carries it beside the rounded "19M" it displays, and null when the uploader hides likes.
- A YouTube video has `commentCount: null`: the logged-out watch page does not show a comment total, and we return null rather than round the displayed figure.
- A premiere or upcoming video has no view count yet, and a channel can hide its subscriber count, so `viewCount` and `followerCount` can be null on a healthy response.
- The Shorts grid does not render a duration or publish date, so both are null there; `extra_fetch=true` fills the exact view count, publish date and duration from each Short at 1 credit per item.
- YouTube comments come about 20 per page and the Shorts grid about 48, each with a cursor for the next page, while a playlist returns 100 videos per page in playlist order.
Endpoints
- Channel details
/v1/youtube/channel1 credit - Channel videos
/v1/youtube/channel-videos1 credit - Channel community posts
/v1/youtube/channel/community-posts1 credit - Channel live streams
/v1/youtube/channel/lives1 credit - Channel playlists
/v1/youtube/channel/playlists1 credit - Channel shorts
/v1/youtube/channel/shorts1 credit - Community post details
/v1/youtube/community-post1 credit - Playlist contents
/v1/youtube/playlist1 credit - Search videos
/v1/youtube/search1 credit - Search by hashtag
/v1/youtube/search/hashtag1 credit - Search typeahead
/v1/youtube/search/typeahead1 credit - Trending shorts
/v1/youtube/shorts/trending1 credit - Video transcript
/v1/youtube/transcript1 credit - Video or Short details
/v1/youtube/video1 credit - Comment replies
/v1/youtube/video/comment-replies1 credit - Video comments
/v1/youtube/video/comments1 credit - Video sponsors (inferred)
/v1/youtube/video/sponsors1 credit
Questions
- How much does the YouTube API cost?
- Calls cost 1 credit each. Every endpoint is cacheable, and a cache hit costs nothing. A failed request and an empty result are both free, on every endpoint.
- Does the YouTube API need a login or cookies?
- No. Every endpoint reads public, logged-out pages only — no account, no cookies, no session. An API key identifies your own TrueScrape account and nothing else.
- Can I fetch many YouTube targets in one request?
- Yes. 17 of 17 are batchable: one POST to /v1/jobs/batch takes many targets and returns a job id to poll.
- Can I watch YouTube endpoints for changes?
- Yes, 13 of 17. A subscription polls on your schedule and fires your webhook only when the content changed; the rest carry x-subscribable: false in the spec.
- Why does a transcript or comments request fail on an age-restricted YouTube video?
- YouTube serves an age-restricted video's captions and comments only to a signed-in viewer, and this API is logged-out by design. The request returns an `upstream_blocked` error rather than claiming the video has none, and it is not charged. The video's own metadata still comes back from the video endpoint.
- Is there a YouTube trending endpoint?
- YouTube retired its global Trending feed, so the trending endpoint reads the ranked Shorts surface for a region instead. Its results differ from one request to the next, which is why it cannot be watched for changes.
- How do I track new comments on a YouTube video?
- Request comments with `order=newest`. The default `top` order is re-ranked by YouTube and churns between calls. A comment with replies also appears in `replyCursors`; pass that cursor to the comment replies endpoint.
- Does YouTube publish sponsor data?
- No structured sponsor data exists. The sponsors endpoint returns YouTube's own paid-promotion disclosure plus brands, promo codes and affiliate links inferred from the description, each with the line it was read from and a confidence.
From the blog
- How Do You Analyze YouTube Comments Without the API? Top Comments, Questions and Common Words
- Social Media APIs by Platform: What's Official, What It Costs, and What's Public Without a Key
- Minting YouTube PO Tokens in Node: Fixing 0-Byte Caption Responses
- YouTube Without an API Key: RSS, oEmbed, timedtext, and the Endpoints Google Doesn't Document