Is there a new way to get a user's thumbnail via url?

Hi people, I have just run into an issue with my embed code, normally it’s suppossed to get a user’s thumbnail via this url: https://www.roblox.com/headshot-thumbnail/image?userId=119729064&width=300&height=300&format=png

But if you enter that url into the url bar, it returns as a 404 error like so:

My question is if there’s a new url I am supossed to use, and if so where I can find it.

GetUserThumbnailAsync won’t work in this case because I need to use this image externally, not just on roblox.

Here’s an examle that used to work, but no longer does:

local exportEmbed = {
    ["avatar_url"] = "https://www.roblox.com/headshot-thumbnail/image?userId="..tostring(player.UserId).."&width=300&height=300&format=png",
}

And here’s what it looked like:
image_2023-08-23_192154056
As you can see the player’s thumbnail is being used as the avatar

Roblox removed the headshot-thumbnail endpoint (I don’t know why), so now you’ll have to get the Roblox CDN URL indirectly from the REST API.

To get the headshot, you can use this URL: https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds={USERID}&size={SIZE}x{SIZE}&format=Png&isCircular=false&thumbnailType=HeadShot

For example, https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=1&size=420x420&format=Png&isCircular=false&thumbnailType=HeadShot will return this:

{"data":[{"targetId":1,"state":"Completed","imageUrl":"https://tr.rbxcdn.com/ea3425c2b657de9af16c629441e0dcb2/420/420/AvatarHeadshot/Png"}]}

where you’re able to parse imageUrl for the CDN URL.

If you want the full body snapshot, you can use https://thumbnails.roblox.com/v1/users/avatar?userIds={USERID}&size={SIZE}x{SIZE}&format=Png&isCircular=false&thumbnailType=HeadShot

3 Likes

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