Using HttpService to GET avatar headshot from thumbnails.roblox.com returns nil

The title describes my issue pretty well. I’m trying to retrieve an avatar headshot PNG from a player’s userId using the new API at thumbnails.roblox.com and then decode the JSON data; however, it’s returning nil. My code can be found below, any help is much appreciated!

	local success, errormessage = pcall(function()
		jsonData = HttpService:GetAsync("https://thumbnails.roblox.com/v1/users/avatar-headshot?userIds="..tostring(plr.userId).."&size=420x420&format=Png&isCircular=false")
	end)
	local data = HttpService:JSONDecode(jsonData)

Did you try printing the error message if success~=true?
I just tested it and got the following error message:

HttpService is not allowed to access ROBLOX resources

There is a forum post that may help with this (but I haven’t tried it)

1 Like

You can’t make HTTP requests to Roblox APIs from Roblox without a proxy.

Why not use GetThumbnailAsync?

2 Likes

I specifically need a URL since I’m using it for a Discord Webhook embed.

Just tried that and got the same message

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