How to get the price of an item?

Hello fellow developers! I am looking for a way to find out of the price of any time even if it is limited. How can I do that?

1 Like

MarketplaceService:GetProductInfo() might help you.

A code example

local function GetPrice(assetId : number)
  local asset = MarketplaceService:GetProductInfo(assetId, Enum.InfoType.Asset)
  if asset then
    return asset.PriceInRobux
  end
end

print(GetPrice(40893128)) -- 355000
2 Likes

I tried that with the asset id 494291269 and it printed out nil (494291269 = Super super happy face)

Nvm you don’t need the Enum.InfoType.Asset as the 2nd arguement in GetProductInfo

image

It is still not not working and it is printing nil

Nvm, for some reason GetProductInfo doesn’t return a .PriceInRobux value with accessories for some reason.

You’ll have to HttpService to get the price from the website but idk how to do that.

Sorry it was my problem! It turns out super super happy face doesnt have an original price.

It does just not for limited items.

print(game.MarketplaceService:GetProductInfo(271014536).PriceInRobux) --7000

There’s an API endpoint for retrieving a list of a limited’s resellers.
https://economy.roblox.com/v1/assets/494291269/resellers

Could you tell me how to do that please?