Get Limited Item's best price? Help requesting API
Asked by
4 years ago Edited 4 years ago
Hello! I have made a game that gets a limited item's best price in the past, but that sent a request to a bot which then returns the best price. However the bot goes down here and there, and it is not the best. I have seen that it is possible using https service. I have made a total RAP count and even the player's limited list, but cannot figure out how to get the best price of an item. I have checked out this, but do not know how to request what I am looking for: https://developer.roblox.com/en-us/articles/Catalog-API
At the bottom it mentions "BestPrice" is for limited items and it returns the best price. I am unsure how to get this though, if it helps here are my other scripts. (Total RAP and limited list)
RAP
01 | local httpService = game:GetService( "HttpService" ) |
03 | local function GetTotalRAP(userId) |
04 | local success, msg = pcall ( function () |
07 | local function CollectRAP(cursor) |
11 | url = url .. "&cursor=" .. cursor |
14 | local data = httpService:GetAsync(url) |
15 | data = httpService:JSONDecode(data) |
17 | for i = 1 , #data [ "data" ] do |
19 | total = total + data [ "data" ] [ i ] [ "recentAveragePrice" ] |
23 | if data [ "nextPageCursor" ] then |
24 | CollectRAP(data [ "nextPageCursor" ] ) |
Limited list (Clones UI and puts in player)
01 | local httpService = game:GetService( "HttpService" ) |
04 | local success, msg = pcall ( function () |
05 | local userId = plr.UserId |
08 | local function CollectRAP(cursor) |
12 | url = url .. "&cursor=" .. cursor |
15 | local data = httpService:GetAsync(url) |
16 | data = httpService:JSONDecode(data) |
18 | for i = 1 , #data [ "data" ] do |
21 | local clone = plr.PlayerGui.List.ScrollingFrame.TextLabel:Clone() |
22 | clone.Parent = plr.PlayerGui.List.ScrollingFrame |
23 | clone.Text = data [ "data" ] [ i ] [ "name" ] .. " | " ..data [ "data" ] [ i ] [ "recentAveragePrice" ] |
24 | clone.Name = "Limited" |
29 | plr.PlayerGui.List.ScrollingFrame.User.Text = plr.Name.. "'s Limiteds" |
32 | plr.PlayerGui.List.ScrollingFrame.TextLabel:Destroy() |
35 | if data [ "nextPageCursor" ] then |
36 | CollectRAP(data [ "nextPageCursor" ] ) |
I am stumped with this issue, if anybody can help me get the "BestPrice" value that would be great! Thank you, feel free to ask any questions or suggest anything at all!
Related posts that didn't seem to help me understand:
https://devforum.roblox.com/t/how-to-get-price-of-limited/408749
https://devforum.roblox.com/t/best-way-to-get-the-limiteds-price/318018
https://devforum.roblox.com/t/how-to-get-the-best-price-of-a-limited-item/933494
https://scriptinghelpers.org/questions/84226/is-there-an-api-endpoint-for-lowest-price-on-limiteds
https://scriptinghelpers.org/questions/59732/how-could-i-get-data-from-limiteds
Please note that the scripts above is just other catalog API, not anything that is erroring, I just need help getting the API.