Blog · · 4 min read
Get a YouTube Channel's Banner and Profile Picture With an API
Read a YouTube channel's full-size banner and profile picture as image links from one request. Every size YouTube serves, working code, and the rules on using the images.
A YouTube channel's banner and profile picture are its public face. Designers check them when they build a mock-up, agencies keep them in a client's brand file, and directories show them next to a channel's name. YouTube serves the banner in several crop sizes, and the full-size original is not easy to find by hand. This guide shows how to get all of them with a single GET request.
Request the images
Send the channel as channel_id. A handle like @NASA, a channel link and a channel ID all work. Every call needs an API key. New accounts get 100 free credits and a first key is created automatically on sign-up (it is shown once on the dashboard). Sign in at scrapingrabbit.com/login, then send the key in the x-api-key header (a Bearer token also works). The code below reads it from the SCRAPINGRABBIT_API_KEY environment variable, so no key is ever written into your code.
curl -H "x-api-key: $SCRAPINGRABBIT_API_KEY" "https://api.scrapingrabbit.com/v1/youtube/channel/banner?channel_id=@NASA"
A successful call costs 1 credit, as the OpenAPI file lists it. Failed calls are not charged.
A shortened real answer, read on 3 December 2026 for NASA's channel. The image links are very long, so we cut them and kept three of the six sizes:
{
"success": true,
"data": {
"channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ",
"handle": "http://www.youtube.com/@NASA",
"title": "NASA",
"avatar": "https://yt3.googleusercontent.com/eIf5fNPc...=s900-c-k-c0x00ffffff-no-rj",
"has_banner": true,
"banner": {
"original": "https://yt3.googleusercontent.com/y8Srh-oC...=s0",
"largest": "https://yt3.googleusercontent.com/y8Srh-oC...=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"sizes": [
{ "url": "https://yt3.googleusercontent.com/y8Srh-oC...=w1060-...", "width": 1060, "height": 175 },
{ "url": "https://yt3.googleusercontent.com/y8Srh-oC...=w1707-...", "width": 1707, "height": 283 },
{ "url": "https://yt3.googleusercontent.com/y8Srh-oC...=w2560-...", "width": 2560, "height": 424 }
]
}
}
}
What the fields mean
| Field | Meaning |
|---|---|
channel_id | The channel's real ID, which starts with UC |
title | The channel name |
avatar | The profile picture, as a link to a 900 pixel image |
has_banner | true when the channel has a banner |
banner.original | The banner as uploaded, with no crop |
banner.largest | The largest crop YouTube serves, 2560 pixels wide |
banner.sizes | Every crop size YouTube serves, each with its link, width and height |
The real answer listed six sizes, from 1060 up to 2560 pixels wide. Each one is about six times wider than it is tall, so pick the one closest to the width you need.
Download the images
This code reads a channel and saves the profile picture and the largest banner to files.
import { writeFile } from "node:fs/promises";
async function saveImages(channel) {
const url = `https://api.scrapingrabbit.com/v1/youtube/channel/banner?channel_id=${encodeURIComponent(channel)}`;
const res = await fetch(url, { headers: { "x-api-key": process.env.SCRAPINGRABBIT_API_KEY } });
const body = await res.json();
if (!body.success) return null;
const { avatar, has_banner, banner, channel_id } = body.data;
const save = async (link, name) => writeFile(name, Buffer.from(await (await fetch(link)).arrayBuffer()));
await save(avatar, `${channel_id}-avatar.jpg`);
if (has_banner) await save(banner.largest, `${channel_id}-banner.jpg`);
return { channel_id, savedBanner: has_banner };
}
console.log(await saveImages("@NASA"));
The code returns null when the call fails. It only saves the banner when has_banner is true, because a channel without a banner has no banner fields to read. The files are named with a .jpg ending, but we did not check the image format the links return, so open a saved file to confirm it before you rely on the extension.
The same in Python:
import os
import requests
res = requests.get(
"https://api.scrapingrabbit.com/v1/youtube/channel/banner",
params={"channel_id": "@NASA"},
headers={"x-api-key": os.environ["SCRAPINGRABBIT_API_KEY"]},
timeout=60,
)
body = res.json()
if body.get("success"):
data = body["data"]
with open(f"{data['channel_id']}-avatar.jpg", "wb") as f:
f.write(requests.get(data["avatar"], timeout=60).content)
if data["has_banner"]:
with open(f"{data['channel_id']}-banner.jpg", "wb") as f:
f.write(requests.get(data["banner"]["largest"], timeout=60).content)
Go further
To turn a handle into a channel ID first, or to read a channel's subscribers and video count, see our YouTube channel stats guide. Together the two calls give you a channel's name, numbers and images for 2 credits.
Things to plan for
- The images belong to the channel owner. Use them only as the owner allows. A banner in a mock-up is one thing, and a banner on your own site is another.
- Some channels have no banner. Then
has_bannerisfalseand you get only the profile picture. - Links can change. If an owner uploads a new banner, the old link may stop matching. Save the files you need, and store the date you read them.
- Pick the size you need. The largest crop is 2560 pixels wide. The smaller ones load faster.
- Rate limits and credits. Each key is limited per minute: 10 requests on the free plan, 60 on Starter, 120 on Pro and 300 on Scale. Every successful call costs 1 credit.
- Always check
success. A failed request returnssuccess: false, acodesuch asRATE_LIMITEDorINVALID_API_KEY, and amessage. Failed calls are not charged.
Try it without code
The free YouTube banner downloader works in the browser with no key and shows a channel's banner and profile picture for any handle you type.
Try it yourself
Frequently asked questions
What can I pass in?
A channel handle like @NASA, a youtube.com link to the channel, or a channel ID.
What if the channel has no banner?
Then has_banner is false and you get only the profile picture. Check has_banner before you read the banner fields.
Can I reuse the images?
The images belong to the channel owner. Use them only as the owner allows.