How to get a price of a gamepass?

I’ll not waste your time, but I want to get price of a gamepass, but I quickly thought of Httpservice, but I don’t know what would be an example url. Thanks

1 Like

you can use GetProductInfo

https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo

here the code:

local MarketplaceService = game:GetService("MarketplaceService")
local ProductInfo = MarketplaceService:GetProductInfo(your gamepass id, Enum.InfoType.GamePass)

print(ProductInfo.PriceInRobux) -- price of the gamepass
12 Likes

bro I keep missing these functions and use an external one, thanks

this one is not working for me, says “8” meanwhile the price is 25

make sure you put the correct gamepass id

it is the correct gamepass id.

Can you send me the ID of the gamepass you’re checking? I want to confirm for myself if that’s alright with you and help you further. :slight_smile:

image
Gamepass id: 26486689
Gives me the price: 8
(6) Music Gamepass - Roblox

ignore music gamepass, i have to change it bc of update

local MarketplaceService = game:GetService("MarketplaceService")
local ProductInfo = MarketplaceService:GetProductInfo(26486689, Enum.InfoType.GamePass)

print(ProductInfo.PriceInRobux) 

image_2022-03-23_052628

Gave me 35 while testing to confirm. Are you sure you’re setting the TextLabels text correctly?

Yes, i’m setting it right.

image

:GetProductInfo() is returning it badly.

well i think this can be why its giving me an error,
let me try it

Is it now working for you or not?

1 Like