How to use the for headshot images with a url

Hey developers. Roblox changed their image API for Avatar headshots, with this . 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:
Simply replace userIds with, your userIds.

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

    ).then(response => response.json())
    .then(data => {
      const imageUrl =[0].imageUrl; // image url
    .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.

1 Like

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