Hi community
I am working on a game similar to Pls Donate, and I need to get the items for sale (shirts, pants, gamepasses, ect) from a specific player. But I’ve been looking for a Roblox WEB API and I haven’t found any endpoint for what I need. I am currently using these:
- catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName=%s
- www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=%s&userId=%s
I have been checking the apis in this repository, but none of them have documented the endpoints I am using, and I don’t know where else to look because everything is very old and it doesn’t work for me.
I hope you can help me, I really need it
More information
When getting player passes and shirts, they load shirts that belong to someone other than the actual player (and the name, price and all that comes out perfect except for the id. And everything is obtained correctly).
Some players don’t get their gamepasses while others do (but with the error I said before) .
--!strict
-- TODO: improve the code
------------------------------------------------------------------------------------------------------------------------------------------
local GAMEPASS_URL = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=%s&userId=%s"
local SHIRTS_URL = "https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName=%s"
------------------------------------------------------------------------------------------------------------------------------------------
local HttpService = game:GetService("HttpService")
local AssetManager = {}
function AssetManager:GetAssets(player: Player)
return {
Shirts = self:__GetShirts(player),
Gamepasses = self:__GetGamepasses(player)
}
end
function AssetManager:__GetGamepasses(player: Player)
local gamepasses = {}
local data = HttpService:JSONDecode(HttpService:GetAsync(GAMEPASS_URL:format(1, player.UserId))).Data
for _, gamepass in data.Items do
-- Some passes do not come with these properties, and may give an error.
pcall(function()
if gamepass.Creator.Id == player.UserId and gamepass.Product and gamepass.Product.PriceInRobux then
table.insert(gamepasses, gamepass)
end
end)
end
return gamepasses
end
function AssetManager:__GetShirts(player: Player)
local shirts = {}
local data = HttpService:JSONDecode(HttpService:GetAsync(SHIRTS_URL:format(player.Name))).data
for _, shirt in data do
if shirt.price > 0 then
table.insert(shirts, shirt)
end
end
return shirts
end
return AssetManager