(https://inventory.roproxy.com/v2/users/"..tostring(plr.UserId).."/inventory?assetTypes="..types[i].."&limit=100&sortOrder=Asc)
Is there any way to load more than 100 items in roproxy.inventory.com?
(https://inventory.roproxy.com/v2/users/"..tostring(plr.UserId).."/inventory?assetTypes="..types[i].."&limit=100&sortOrder=Asc)
Is there any way to load more than 100 items in roproxy.inventory.com?
You can not exceed 100 items per inventory request. However, you can get the next page cursor. If it is not nil, then you would run the HTTP again, but with the cursor set to the next page you were given from the request earlier.
The request is paginated, this means that it returns a cursor that when put in the url as a parameter, it returns the next x
results(in this case the next 100). When the cursor returned is nil, it means you reached the last page. The pagination should look like this:
local cursor = ""
local url = "your request url here"
while cursor do
local response = game.HttpService:GetAsync(url.."&cursor="..cursor)
local data = game.HttpService:JSONDecode(response)
--process returned results
for _, v in pairs(data.data) do
print(game.HttpService:JSONEncode(v))
end
--after that do:
cursor = data.nextPageCursor
end
You can think of this as clicking the next page button on the website multiple times until you have browsed all pages.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.