Scraping a YouTube channel, for an app, means two reads: who the channel is, and what it uploaded. Both are GET requests. Neither one is the official YouTube Data API. Both return the fields SocialScrape records for those routes.
Send the key as x-api-key. See authentication.
The channel
GET /v1/youtube/channel returns the name, avatar, subscribers, video and view counts, join date, country and linked links. Pass a handle, an id (the UC... channel id) or a channel url.
One of the three is required. username aliases handle. channelId and channel_id alias id. A URL can be /@handle, /channel/UC... or /c/name.
The recorded request uses a handle.
1curl -G "https://api.socialscrape.dev/v1/youtube/channel" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "handle=NASA"1import os2import requests34params = {5 "handle": "NASA",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/youtube/channel",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11)12body = res.json()1314if body["ok"]:15 print(body["data"])16else:17 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/youtube/channel");2url.search = new URLSearchParams({3 "handle": "NASA"4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}data- is a profile.
platformisyoutube. You getid,handle,name,headline,url,bio,avatar_url,banner_url,verified,is_private,external_url,links,location,categoryandcreated_at. Empty platform fields are null. stats.followers- is the subscriber count as returned.
stats.postsis the video count.stats.viewsis the channel view total.stats.followingandstats.likesare null when the channel page does not have them. extra- carries the parts that do not fit the shared profile. On a channel that includes
channel_url,rss_url,keywords,joined_text,is_family_safe,is_live,is_unlisted,verified_kind,video_count_text,subscribers_textandsubscribers_approximate. Readsubscribers_approximatebefore you printstats.followersas an exact integer. When it is true, YouTube rounded the figure, andsubscribers_textis the label YouTube showed.facebook_profile_idis set when the channel page links a Facebook profile id. It is not a Facebook scrape by itself.
Sample. The recorded handle is NASA, and the sample is shortened. Cite it as a sample, not as today's subscriber total.
Errors on this route are invalid_params, unsupported_url and not_found. A bad URL shape is unsupported_url. An unknown channel is not_found. Do not retry either.
The uploads
GET /v1/youtube/channel/videos- lists the channel's uploads, newest first or most popular. You page with
cursor(YouTube's continuation token). The same one-of applies:handle,idorurl. sort- is
latestorpopular. Changing sort restarts the cursor chain.include_extrasalso fetches likes, comment count and description per video. The reference says that is slower and can produce more errors, and that the single video endpoint returns everything. Leave it off unless you need those columns on every row.
The recorded request asks for popular uploads on a handle.
1curl -G "https://api.socialscrape.dev/v1/youtube/channel/videos" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "handle=MrBeast" \4 --data-urlencode "sort=popular"1import os2import requests34params = {5 "handle": "MrBeast",6 "sort": "popular",7}8res = requests.get(9 "https://api.socialscrape.dev/v1/youtube/channel/videos",10 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},11 params=params,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/youtube/channel/videos");2url.search = new URLSearchParams({3 "handle": "MrBeast",4 "sort": "popular"5}).toString();6const res = await fetch(url, {7 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },8});9const body = await res.json();1011if (body.ok) {12 console.log(body.data);13} else {14 console.error(body.error.code, body.error.message);15}data.object- is
list. Eachdata.itemsentry is a post:id,url,type,title,text,published_at,duration_seconds,author,stats,media.stats.viewsis on the row. Likes and comment counts stay null unlessinclude_extraswas set or you callGET /v1/youtube/videofor that id.extra.published_at_approximatemarks a date that is not exact. cursorandhas_more- are on the envelope and inside
data. Whenhas_moreis true, send the same parameters pluscursorset to the value you got. Stop whenhas_moreis false. Each page is its own credit. The loop is documented in pagination. parent- on the list points at the channel.
Cost and cache
A channel is 1 credit. Each page of videos is 1 credit. A page of fifty videos is not one credit if it took several cursors. Count the requests that returned ok: true and were not cached.
Both endpoints are cacheable for 30 days. Send max_age_days to accept a cached copy for 0 credits. Failed requests cost 0. The balance rules, the 100 credit signup grant and the pack prices are in credits and on pricing.
Limits
You get the channel and its upload list, paged. You do not get a private video, a member-only post, or comments, unless you call the comment endpoint on a video URL. Sponsor labels are a separate route, GET /v1/youtube/video/sponsors, and the use-case notes on this site call that detection experimental. Do not treat a missing sponsor row as proof of no sponsor.
sort=latest and sort=popular are the two values this list accepts. This is not YouTube search. Search has its own sort rules: latest and rating are refused there. Do not copy search parameters onto the channel list.
Packs and plans have no rate limits; free accounts have a lower one. A 429 is free and retryable. See rate limits.
New fields can appear. Null stays null when YouTube did not send a value.
Next
Channel facts and the sample are on the YouTube channel API page and in the reference. Uploads are the channel videos API and how to scrape YouTube channel videos. The channel tutorial is how to scrape a YouTube channel, with Python and JavaScript. The group hub is the YouTube API.
Watching a channel for new uploads, instead of polling, is a monitor on the list endpoint. See monitors and webhooks and the monitors reference.