Heres the script (Server) that returns the result.
local http = game:GetService("HttpService")
local remote = game.ReplicatedStorage.Remotes.HttpRequest
function remote.OnServerInvoke(plr,page)
local url = "https://catalog.roblox.com/v1/search/items/details?Category=11&Subcategory=9&Limit=30"
local get = http:GetAsync(url)
local json = http:JSONDecode(get) -- Into a lua table
return json
end
The local script has nothing in. All i want, is to know how to get the items in a page and get the data of it.
local http = game:GetService("HttpService")
local remote = game.ReplicatedStorage.Remotes.HttpRequest
function remote.OnServerInvoke(plr,page)
local url = "https://catalog.rprxy.xyz/v1/search/items/details?Category=11&Subcategory=9&Limit=30"
local get = http:GetAsync(url)
local json = http:JSONDecode(get) -- Into a lua table
return json
end
Ah gotcha I just did some experimenting and looked at the requests roblox makes when you go on the catalog:
You can’t ask for “page 1”, “page 2”, etc. – the API doesn’t seem to support that. However, you CAN move forward pages by adding a &cursor= parameter to the end of the URL, and set it to the nextPageCursor value you got from the first page. For example:
local url= "https://catalog.rprxy.xyz/v1/search/items/details?Category=11&Subcategory=9&Limit=30"
local firstPage = http:JSONDecode(http:GetAsync(url));
local nextCursor = firstPage["nextPageCursor"]
local secondPage = http:JSONDecode(http:GetAsync(url .. "&cursor=" .. nextCursor));
local thirdPage = http:JSONDecode(http:GetAsync(url .. "&cursor=" .. secondPage["nextPageCursor"]));
local sameAsFirstPage = http:JSONDecode(http:GetAsync(url .. "&cursor=" .. secondPage["previousPageCursor"]));
edit: I should also mention that if there’s no page to go back to (like on the first page), previousPageCursor will be nil