YouTube channel videos API
A channel's uploads, newest first or most popular.
GET /v1/youtube/channel/videos
GET /v1/youtube/channel/videos
A channel's uploads, newest first or most popular. Page with cursor (the continuationToken).
- Cost: 1 credit
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
handle | string | one of | Channel handle, with or without @. Also accepted as username. |
id | string | one of | Channel id (UC...). Also accepted as channelId, channel_id. |
url | URL | one of | Any channel URL (/@handle, /channel/UC..., /c/name). Accepted hosts: youtube.com, youtu.be. |
sort | string | no | Order of results. Changing it restarts the cursor chain. One of latest, popular. Default latest. Also accepted as sort_by, sortBy, order. Also accepted values: newest for latest. |
include_extras | boolean | no | Also fetch likes, comment count and description per video (slower, more errors). The video endpoint returns everything. Default false. Also accepted as includeExtras. |
Send at least one of handle, id, url. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
cursor: the cursor from the previous page (Pagination).trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
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}1{2 "nodes": [3 {4 "name": "SocialScrape YouTube channel videos",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/youtube/channel/videos",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "handle",19 "value": "MrBeast"20 },21 {22 "name": "sort",23 "value": "popular"24 }25 ]26 },27 "sendHeaders": true,28 "headerParameters": {29 "parameters": [30 {31 "name": "x-api-key",32 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"33 }34 ]35 }36 }37 }38 ],39 "connections": {}40}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_6bc2ed2960b876c4d3c230e6",8 "data": {9 "object": "list",10 "items": [11 {12 "object": "post",13 "platform": "youtube",14 "id": "0e3GPea1Tyg",15 "url": "https://www.youtube.com/watch?v=0e3GPea1Tyg",16 "type": "video",17 "author": {18 "id": "UCX6OQ3DkcsbYNE6H8uQQuVA",19 "handle": "MrBeast",20 "name": "MrBeast",21 "url": "https://www.youtube.com/@MrBeast",22 "avatar_url": null,23 "verified": null24 },25 "title": "$456,000 Squid Game In Real Life!",26 "text": null,27 "published_at": "2022-10-30T00:00:00Z",28 "duration_seconds": 1542.0,29 "language": null,30 "hashtags": null,31 "mentions": null,32 "stats": {33 "views": 979000000,34 "likes": null,35 "comments": null,36 "shares": null,37 "saves": null,38 "dislikes": null39 },40 "media": {41 "thumbnail_url": "https://i.ytimg.com/vi/0e3GPea1Tyg/mqdefault.jpg",42 "video_url": null,43 "audio_url": null,44 "image_urls": null,45 "width": null,46 "height": null47 },48 "song": null,49 "location": null,50 "is_pinned": null,51 "is_sponsored": null,52 "extra": {53 "published_at_approximate": true54 }55 },56 {57 "object": "post",58 "platform": "youtube",59 "id": "1WEAJ-DFkHE",60 "url": "https://www.youtube.com/watch?v=1WEAJ-DFkHE",61 "type": "video",62 "author": {63 "id": "UCX6OQ3DkcsbYNE6H8uQQuVA",64 "handle": "MrBeast",65 "name": "MrBeast",66 "url": "https://www.youtube.com/@MrBeast",67 "avatar_url": null,68 "verified": null69 },70 "title": "$1 vs $500,000 Plane Ticket!",71 "text": null,72 "published_at": "2023-10-30T00:00:00Z",73 "duration_seconds": 631.0,74 "language": null,75 "hashtags": null,76 "mentions": null,77 "stats": {78 "views": 608000000,79 "likes": null,80 "comments": null,81 "shares": null,82 "saves": null,83 "dislikes": null84 },85 "media": {86 "thumbnail_url": "https://i.ytimg.com/vi/1WEAJ-DFkHE/mqdefault.jpg",87 "video_url": null,88 "audio_url": null,89 "image_urls": null,90 "width": null,91 "height": null92 },93 "song": null,94 "location": null,95 "is_pinned": null,96 "is_sponsored": null,97 "extra": {98 "published_at_approximate": true99 }100 }101 ],102 "cursor": "o30",103 "has_more": true,104 "parent": null105 },106 "cursor": "o30",107 "has_more": true108}Response#
A list of Post objects in data.items, with data.cursor and data.has_more.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
Every request can also fail with the account and platform errors listed on the Errors page.
Also served at#
These paths answer the same request, so code written for other APIs keeps working: /v1/youtube/channel-videos. See Switching from ScrapeCreators.
Related endpoints#
- YouTube channel details (
GET /v1/youtube/channel) - Search inside a YouTube channel (
GET /v1/youtube/channel/search) - YouTube channel playlists (
GET /v1/youtube/channel/playlists) - YouTube channel Shorts (
GET /v1/youtube/channel/shorts) - YouTube channel live streams (
GET /v1/youtube/channel/lives) - YouTube channel community posts (
GET /v1/youtube/channel/community-posts) - YouTube video or Short details (
GET /v1/youtube/video) - YouTube video transcript (
GET /v1/youtube/video/transcript)