How does Roblox HTTP work?

hey by the way does avatar api work when there inventory is disabled

(and im not trying to just get the currently wearing items, but ALL their items)

If you getting the entire player’s inventory then you should check first if the player’s inventory is viewable. And no the avatar api does not do inventory related stuff. So you can probably discard the example code since i didn’t know you wanted to get all a player’s items

So can the avatar API see what the player is currently wearing even if their inventory is off or does the inventory still have to be on? (sorry for late response I went to bed it was like 2am)_

The currently worn avatar items of a player can be fetched regardless if their inventory is viewable or not

With the release of the ‘AvatarEditorService’ this no longer needs to be handled by the ‘HttpService’.
https://developer.roblox.com/en-us/api-reference/function/AvatarEditorService/GetInventory

1 Like

I’m already using it but it’s blocked with inventory set to off

The API wouldn’t be able to get the inventory of a user that’s hidden theirs either. If you just need a player’s on-site appearance you can use GetCharacterAppearanceInfoAsync.
https://developer.roblox.com/en-us/api-reference/function/Players/GetCharacterAppearanceInfoAsync

1 Like

okay. BTW I’m working on furry detector 2.0

hey I know this is a late response but i noticed that this solutioned has an accessory cap. It’s not showing their ENTIRE inventory and only like the first 50.

I rely HEAVILY on getting ALL their info. What’s up with this???

edit: this is the url:

["Avatar"] = "https://inventory.roproxy.com/v2/users/"..UserId.."/inventory?assetTypes="..AvatarList.."&itemsPerPage=100",

(changing the “&itemsPerPage=100” to a higher number than 100 has no effect.)

Oh, I forgot to say that it only goes through the first 100 items of the player’s inventory. Also, I would provide a fix to this, if Roblox’s API wasn’t broken and didn’t error when trying to go to the next page of the user’s inventory. Inventory Api If you were to enter all of the data properly and try to use the next page cursor to view the next page, it just returns (it sometimes lets you go through one or two pages, but it’s quite rare and is usually when you aren’t showing many items at once).


Therefore, there is currently no fix to this problem that I can provide or know of. Here is the code I was going to provide, but realized that it didn’t work due to that:

local HTTP = game:GetService("HttpService")
local assettypes = {
	"Pants",
	"Shirt",
	"Hat",
	"Face",
	"Gear",
	"Place",
	"Audio",
	"Face",
	"Package",
	"Animation",
	"Torso",
	"RightArm", 
	"LeftArm", 
	"LeftLeg", 
	"RightLeg",
	"HairAccessory",
	"FaceAccessory",
	"NeckAccessory",
	"ShoulderAccessory",
	"FrontAccessory",
	"BackAccessory",
	"WaistAccessory",
	"EmoteAnimation",
	"Video",
	"JacketAccessory",
	"SweaterAccessory",
	"ShortsAccessory",
	"LeftShoeAccessory",
	"RightShoeAccessory",
	"DressSkirtAccessory"
}

local assetlist = table.concat(assettypes, ",")

game.Players.PlayerAdded:Connect(function(plr)
	local inventory = {}
	local cursor = nil

	repeat
		local url = "https://inventory.roproxy.com/v2/users/"..plr.UserId.."/inventory?assetTypes="..assetlist.."&itemsPerPage=100"

		if cursor then
			url ..= "&cursor="..cursor
		end

		local data = HTTP:GetAsync(url ,true)
		data = HTTP:JSONDecode(data)

		if #data.data > 0 then
			table.insert(inventory, data.data)
		end

		if data.nextPageCursor then
			cursor = data.nextPageCursor
		end
	until not data.nextPageCursor

	print(inventory)
end)

Maybe i could request the information in seperate requests

That is what it does, separate requests. It needs to do them one by one until there is no longer another page. But, it errors on the second or third request since Roblox’s API has quite a few problems.

Are they going to fix it soon? also when i mean multiple requests I mean doing different tables not pages

The table isn’t the problem. The problem is on Roblox’s side, as it’s their API having trouble going through the pages. I’m not sure if they will fix it soon, you would have to ask a Roblox staff about that one.

When i add less items to the table it brings more different items up. When i add those items that i removed and add them to a seperate table then get the info of both tables it works just fine getting the info of both everytime

maybe its already fixed? did you test if it was still broken

Not sure. It might be because you are doing fewer items at once, which I wanted to avoid since it would be using a lot of requests, but I will try it on my side with fewer items.

Edit: Even with fewer items, it still returned HTTP 403 (Forbidden) for me. (My inventory was private, scratch that, I will retest)

Edit 2: Tested again, inventory was allowed to everyone this time, but still error on the second run (the one with the cursor) and I only had 10 items at a time.

Maybe it errors when there is no second page available>?

No, the repeat would then end if there was no new available cursor. I believe it has something to do with the proxy I’m using, as it is provided a different cursor than Roblox’s API is returning, but even then, the Roblox side still sometimes errors. Ok, I had a few less items on the roblox API side, so i believe the problem could be some of the items in the list.

Alright, I changed to the item list I was using on the roblox side and it works better and doesn’t error:

local HTTP = game:GetService("HttpService")

local assetlist = "Pants,Shirt,Hat,Face,Gear,Audio,Face,Package,Animation,Torso,RightArm,LeftArm,LeftLeg,RightLeg,HairAccessory,FaceAccessory,NeckAccessory,ShoulderAccessory,FrontAccessory,BackAccessory,WaistAccessory,EmoteAnimation,Video,JacketAccessory,RightShoeAccessory,DressSkirtAccessory"

game.Players.PlayerAdded:Connect(function(plr)
	local inventory = {}
	local cursor = nil

	repeat
		local url = "https://inventory.roproxy.com/v2/users/"..plr.UserId.."/inventory?assetTypes="..assetlist.."&itemsPerPage=10&sortOrder=Asc"

		if cursor then
			url ..= "&cursor="..cursor
		end

		local data = HTTP:GetAsync(url ,true)
		data = HTTP:JSONDecode(data)

		if #data.data > 0 then
			for i,v in pairs(data.data) do
				table.insert(inventory, v)
			end
		end

		if data.nextPageCursor then
			cursor = data.nextPageCursor
		end
	until not data.nextPageCursor

	print(inventory)
end)
1 Like

Roblox is picky about which items u can run but all the ones i included should be good