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

YouTube channel details API

Name, avatar, subscribers, video and view counts, join date, country and linked links.

GET /v1/youtube/channel

GET /v1/youtube/channel

Name, avatar, subscribers, video and view counts, join date, country and linked links. Pass a handle, an id (channelId) or a channel 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:

  • 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" \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, dash characters in the text are replaced with hyphens. 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_361e8bbed3bc9681bdc6d240",8  "data": {9    "object": "profile",10    "platform": "youtube",11    "id": "UCLA_DiR1FfKNvjuUpBHmylQ",12    "handle": "NASA",13    "name": "NASA",14    "headline": null,15    "url": "https://www.youtube.com/@NASA",16    "kind": "channel",17    "bio": "NASA's mission is to pioneer the future in space exploration, scientific discovery, and aeronautics research.\r\n\r\nTo do that, we have worked around the world - and off it - for more than 60 years, searching for answers to fundamental questions a...",18    "avatar_url": "https://yt3.googleusercontent.com/eIf5fNPcIcj9ig-wZBeq4stFy1lgjWTW1nLT5dYlFkHZprZ03QBiMcbpwNMB6XSBjrSFGtAGQg=s160-c-k-c0x00ffffff-no-rj",19    "banner_url": "https://yt3.googleusercontent.com/y8Srh-oCcilLvBO8jAPI546m1bn0puA5DIvQiBZ1cSxc_rZfKxKSFlTCtoCQCtB6viUf1NGsaQ=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",20    "verified": true,21    "is_private": null,22    "external_url": "https://www.nasa.gov",23    "links": [24      {25        "title": "nasa.gov",26        "url": "https://www.nasa.gov"27      },28      {29        "title": "X",30        "url": "https://x.com/nasa"31      },32      {33        "title": "Facebook",34        "url": "https://www.facebook.com/NASA"35      }36    ],37    "location": null,38    "category": null,39    "created_at": "2008-06-03T00:00:00Z",40    "stats": {41      "followers": 15100000,42      "following": null,43      "posts": 6195,44      "likes": null,45      "views": 113279412046    },47    "extra": {48      "channel_url": "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ",49      "facebook_profile_id": "NASA",50      "is_family_safe": true,51      "is_live": true,52      "is_unlisted": false,53      "joined_text": "Joined Jun 3, 2008",54      "keywords": [55        "nasa",56        "space",57        "iss"58      ],59      "rss_url": "https://www.youtube.com/feeds/videos.xml?channel_id=UCLA_DiR1FfKNvjuUpBHmylQ",60      "subscribers_approximate": true,61      "subscribers_text": "15.1M subscribers",62      "verified_kind": "verified",63      "video_count_text": "6.1K videos"64    }65  },66  "cursor": null,67  "has_more": null68}

Response#

A Profile object in data.

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.

Example error:

1{2  "ok": false,3  "error": {4    "code": "not_found",5    "message": "The platform says this profile, post or item does not exist.",6    "retryable": false7  },8  "credits_charged": 0,9  "request_id": "req_0f0ff40c1be1850878270ad9"10}