How to use the thumbnails.roblox.com for headshot images with a url

Hey developers. Roblox changed their image API for Avatar headshots, with this thumbnails.roblox.com . My question is how can I grab the url of this head shot image from this? I have looked in the dev forum for a post with a answer and haven’t found one that I could understand. All I need is the url of a image. Anyone able to help me? Any help is appreciated, I’ve been stuck on this for hours.

You can get a headshot image url by doing a GET request using this url: https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=1&size=420x420&format=Png&isCircular=false
Simply replace userIds with, your userIds.

Then, to get the image URL, you can do (JavaScript):

fetch(
    "https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=957413104&size=420x420&format=Png&isCircular=false",
    ).then(response => response.json())
    .then(data => {
      const imageUrl = data.data[0].imageUrl; // image url
      console.log(imageUrl);
    })
    .catch(error => console.log(error) // for errors
);

Roblox games cannot access Roblox APIs, so it is impossible to do within a game, unless you use a Proxy.

Don’t question the code formatting, I’m not efficient in JS.

2 Likes

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