Skip to content

Getting YouTube user avatar/profile picture by User ID


For example, my YouTube channel (himself0890) User ID is: zRJMLe36PT0Q2mhlmbU2OQ

So, my avatar url could be: or it could be

I had the issue in Python when retrieving the User ID from the newsubscriptionvideos feed…

So, I recently ran into the problem where YouTube doesn’t return the author’s profile picture in their feed (specifically the newsubscriptionvideos feed).

After checking out some of the XML they gave me back, I noticed that if I hit their newsubscriptionvideos v2 API, the Author element contains the “ns1:userId” tag.

If you have any questions on how to parse this tag for the user ID in Python, feel free to drop a comment and I’ll help you out.


  1. Hello, I have found this methodolgy does not always work. Also, because it is not contained in Google documentation, it is not guaranteed to always be available. I have discovered an alternate way of display the profile picture of a given username using a little piece of javascript to get and then display the picture from the youtube feed api.

    Basically you can make a call to this url:,media:thumbnail,title&alt=json-in-script&format=5&callback=showYouTubeProfileInfo replacing the [username] with the user you want. This url returns the results as a json wrapped in a .js file which will call the javascript function provided in the paramter ‘callback’. e.g. function showYouTubeProfileInfo(data)
    document.getElementById(‘userprofile’).innerHTML = ” “;

    This then enables you to process the returned data and display it.

    I have got sample code here which you can use.

  2. Hello. Sorry it seems some of the javascript in my above comment has been stripped out. The innerHTML should contain a image tag with the src set to:$thumbnail.url

    Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *