How to get a limiteds product info?

My script:

local MarketplaceService = game:GetService("MarketplaceService")
local assetId = 26011378
local productInfo = MarketplaceService:GetProductInfo(assetId, Enum.InfoType.Asset)

print(productInfo.PriceInRobux)

It returns 7 which is the original price of the limited, how would I get it’s recent average price? I used the catalog api system it worked in the website but I don’t know how to log it in studio so I found a way to log an items price with marketplace service, but it only returned the original price. How would I get the recent average price? (RAP)

Top number = Recent Average Price
Bottom number = Original Price

1 Like

I think It’s should be In #help-and-feedback:scripting-support

1 Like

I am not sure if its possible or not to be sincere, but using the HttpService maybe you could get a jSON file with all the data you need for the specified limited.

Thank you for telling me, changed.

I used http service and it gives me all the info I need, I just don’t know how to return it properly into a script.

Hey, here is a topic that explains it better!

As I know you CAN NOT send requests to Roblox. But you can use proxy. Read more about it here!

Alrigth using the information I found from there, I got to this point.

I don’t know exactly how to get the rap from that, but the data gave me this when I printed it:

image

How do I refer to data > 1 > recentAveragePrice?

data[“data”][1][“recentAveragePrice”]

Alright, thank you. How would I add each ones recentAveragePrice?

My code now:

Try this:

local total = 0
for i = 1, #data["data"] do
   pcall(function()
      total = total + data["data"][i]["recentAveragePrice"]
   end)
end

after that return total and print it

if data then
     local averagePrice = 0

     for i, v in pairs (data["data"]) do
          if data["data"][i]["recentAveragePrice"] then
               averagePrice += data["data"[i]["recentAveragePrice"]
          end
     end
end

That doesn’t return anything for some reason.

This one returns them all individually still even when I return and print it.

What do you mean? It’s not supposed to return a value

Oh my bad, I added a print to it and it prints, it just still returns them all individually for some reason. image

Print the averageprice, not the iteration value

I am printing the average price.image

you are printing it every iteration

print it outside of the loop.

also clean up that loop code -_-

local Success, Result = pcall(HttpService.GetAsync, HttpService, Endpoint:format(UserId))
local Response = HttpService:JSONDecode(Result)

local TotalRap = 0
for i, Asset in pairs(Response.data) do
	TotalRap += Asset.recentAveragePrice
end

print(TotalRap)

OHHH, excuse me, I didn’t know the definition of iteration :smile: thank you!