YouTube channel playlists API
  1. Docs
  2. YouTube
  3. YouTube channel playlists API

YouTube channel playlists API

Playlists from a channel's Playlists tab: id, title, thumbnail, video count and URL.

GET /v1/youtube/channel/playlists

GET /v1/youtube/channel/playlists

Playlists from a channel's Playlists tab: id, title, thumbnail, video count and URL.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
handlestringone ofChannel handle, with or without @. Also accepted as username.
idstringone ofChannel id (UC...). Also accepted as channelId, channel_id.
urlURLone ofAny channel URL (/@handle, /channel/UC..., /c/name). Accepted hosts: youtube.com, youtu.be.

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: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • 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/playlists" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "handle=NASA"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_9828d9a8e516e6c3a87a4e07",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "collection",13        "platform": "youtube",14        "id": "PLF98rxtslw6s",15        "url": "https://www.youtube.com/playlist?list=PLF98rxtslw6s",16        "kind": "playlist",17        "title": "Nancy Grace Roman Space Telescope",18        "description": null,19        "owner": {20          "id": "UCLA_DiR1FfKNvjuUpBHmylQ",21          "handle": "NASA",22          "name": "NASA",23          "url": "https://www.youtube.com/@NASA",24          "avatar_url": null,25          "verified": null26        },27        "item_count": 3,28        "cover_url": "https://i.ytimg.com/vi/9wq3VHsL_bE/hqdefault.jpg?sqp=-oaymwEXCOADEI4CSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLCC7609JJdE1ic8h5PLtaCFmDRDYg",29        "updated_at": null,30        "extra": null31      },32      {33        "object": "collection",34        "platform": "youtube",35        "id": "PLB29CbKaE2OY",36        "url": "https://www.youtube.com/playlist?list=PLB29CbKaE2OY",37        "kind": "playlist",38        "title": "NASA Moon Base",39        "description": null,40        "owner": {41          "id": "UCLA_DiR1FfKNvjuUpBHmylQ",42          "handle": "NASA",43          "name": "NASA",44          "url": "https://www.youtube.com/@NASA",45          "avatar_url": null,46          "verified": null47        },48        "item_count": 9,49        "cover_url": "https://i.ytimg.com/pl_c/PLB29CbKaE2OY/studio_square_thumbnail.jpg?sqp=COf4j9cG-oaymwEICIAKENAFSFqi85f_AwYIqMLO0wY=&rs=AOn4CLBCTs47CUQAUcwD04UtDVoekixpbw",50        "updated_at": null,51        "extra": null52      }53    ],54    "cursor": "o30",55    "has_more": true,56    "parent": null57  },58  "cursor": "o30",59  "has_more": true60}

Response#

A list of Collection 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.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe 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.