Getting player headshot inside a website

Alright so I want to make a website and I’d love to be able to get someones headshot as an image and display it on the web. What I’m looking for is going from having an user id or roblox username to having the player’s headshot displayed in the website.

I’ve seen that roblox shows the players headshot with the following link (in my profile)
https://tr.rbxcdn.com/db97934d0733491409ee6adcea166916/150/150/AvatarHeadshot/Png

I’m pretty sure the db97934d0733491409ee6adcea166916 represents my user id, however I don’t know how to go from an userId to that kind of string. Does anyone know how to do this or any alternative? I’m willing to use javascript in order to achieve this.

You can use the thumbnails API to get the image URL

2 Likes

Alright tysm! I didn’t know that existed, I’ll now test it!

Edit: I ended up not being able to test it (my web hoster ran out). However I can say that That should work. You need to know how to do HTTP Get requests with javascript and that’s it. Thank you so much.

I recommend using Players:GetUserThumbnailAsync() instead, as it doesn’t require a proxy and is intended for this use.

Players:GetUserThumbnailAsync() is only available in game, not externally. OP started his question by stating he wants to make a website. A website is not in game.

Oh, I see. That’s my bad. Thanks for the clarification! :man_facepalming:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.