Help needed for getting an avatar headshot via thumbnails.roblox.com

How would i go about using https://thumbnails.roblox.com/docs#!/Avatar/get_v1_users_avatar_headshot to grab a user’s headshot to be used on a Discord webhook’s profile picture?

I already have a proxy setup, incase that’s of any help.

Here’s the code, if it’s needed

Players.PlayerAdded:Connect(function(plr)
	local data = {
		avatar_url = "Trying to get this";
		username = gameName.Name.." Notifier";
		["content"] = plr.Name.." has joined "..gameName.Name;
	}
	Proxy:Post(webhook, HttpService:JSONEncode(data))
end)

I don’t have a good internet connection right now, but from off the top of my head I don’t think that the thumbnails API is used for getting avatar thumbnails. Pretty sure it’s the avatars API.

Here are some endpoints that you can use:

I use these all the time in external projects. You just need to have the UserId of the player.

Hey, thanks for replying. Unfortunately, these don’t work anymore. I’ve used them in the past as well, but they just don’t show an image.

The thumbnails api does have headshots though, as seen here

When I use the API, it gives the url, but I don’t know how to grab it.

If you don’t understand simple requests to API endpoints I kinda feel like you should not use them.

What I suggest is if you don’t really understand how to use API endpoints using smthing like noblox.js to get it. (that is if ur using node.js)

https://noblox.js.org/global.html#getPlayerThumbnail

1 Like

Well, I’m trying to get a grip on them, so gotta start somewhere, haha.

Just parse the response as JSON.

response.data[0].imageUrl

If the programming language you’re using starts table indexes at 1, then change [0] to [1].

Also, if you don’t understand these things, use a search engine to help you. That’s where most of us started.

1 Like

Also just to add onto what @RecanValor said, ensure you know the basics of how to code in the language ur proxy is in. There is no point u trying to get a grip on using the endpoints if u dont know the basics.

The thing ur asking is really something that if you know the basic you should already know. Really if you know the basic you should know this alreday.

Assuming your proxy library has a “Get” function, you can do something like this

local response = Proxy:Get(string.format("https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds=%d&size=150x150&format=Png&isCircular=false", plr.UserId))

local data = HttpService:JSONDecode(response).data

local avatar_url = data[1].imageUrl

That was exactly what I was doing, haha. Thank you!

Just so you know, those endpoints still work. Glad that you figured it out though.