Help with getting limited(U) item's BestPrice

Hello! I have been recently trying to make a script that prints out a bestprice of a limited item, which is working correctly.
But the main issue is it isnt working on limited**(U)** items, it just prints out “nil”.

Here is my script:

local HttpService = game:GetService("HttpService")
local URL = "https://www.rolimons.com/item/"

function Request(url)
	return HttpService:RequestAsync({
		Url = url;
		Method = "GET";
	})
end

function GetBestPrice(id)
	local HttpResponse = Request(URL .. tostring(id))

	if HttpResponse.Success then
		local Result = HttpResponse.Body

		-- Find the start and end positions of the best_price value
		local startPos, endPos = string.find(Result, '"best_price":%s*(%d+)')

		if startPos and endPos then
			-- Extract the best_price value
			local bestPrice = tonumber(Result:sub(startPos + 13, endPos))

			return bestPrice
		end
	end
end

local anID = 286524574

while true do
	local bestPrice = GetBestPrice(anID)
	warn(bestPrice)
	task.wait(1)
end

If anyone knows how to modify the script to print out a limited(U) item’s bestprice AND limited’s bestprice, i would greatly appreaciate it.

Thanks!

2 Likes

Try this regex instead, "best_price":\s?[0-9]+

Unfortunately did not work.
image

Can you give the url of the item you are trying to extract the best price of?

Here is one for example:

Seems like user created limited pages are set up differently and provide no script json. Give me a minute

This is extremely hacky and will break if they modify the page but try this
Best Price<\/[a-z A-Z]+>?\n?\s+<[a-z A-Z ="-]+>[0-9,]+<\/[a-z A-Z]+>
You will have to adjust your StartPos math

Any reason why you don’t use a free proxy and do a request to https://catalog.roblox.com/v1/catalog/items/ID/details?itemType=Asset ?
It would be simpler and provides what you need.
lowestPrice (best price)

Im a begginer and the i found the script that im using on devforum, so i modified it a little so it wouldnt be messy and it actually worked. Now im just trying to figure out the limited(U) thing.

Ive tried using proxies but i cant really seem to understand how to do they work.
But one thing i notice that i havent seen the API you showed me, so i will try and make it with that.

Hey, so i tried out the API and it actually works! Thanks so much for the help. :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.