Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Youtube channel banner using Youtube API?

I'm working on a PHP project that need to get Youtube channel banner (or cover photo), avatar and uploaded videos from a specific Username.

For avatar and videos, I use: https://gdata.youtube.com/feeds/api/channels?q=Username&alt=json&v=2

But for the channel banner, I have searched on the Internet but no luck. Anyone here can help me? Thank you so much!

like image 825
Hung Nguyen Avatar asked Feb 15 '14 03:02

Hung Nguyen


People also ask

Is YouTube API key free?

YouTube Data API costs are based on quota usage, and all requests will incur at least a 1-point quota cost. For each project, you're allowed 10,000 free quota units per day.

What you can do with YouTube API?

The API provides the ability to retrieve feeds related to videos, users, and playlists. It also provides the ability to manipulate these feeds, such as creating new playlists, adding videos as favorites, and sending messsages. The API is also able to upload videos.


1 Answers

You can do it with V3 of the API. You'll need the actual channel ID (not just the username), and then do a request to:

https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id={CHANNEL-ID}&key={YOUR_API_KEY}

(Note you'll also need an API key from the cloud console).

If you don't have the channel ID, you can get it from the username with this call:

https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&forUsername={USERNAME}&key={YOUR_API_KEY}

like image 173
jlmcdonald Avatar answered Oct 23 '22 07:10

jlmcdonald