MarketplaceService:getProductInfo() failed because HTTP 404 (Not Found)

Hello I have a major issue, i am trying to get a productinfo of a pass and i keep getting http 404 error

Script:

local MarketPlaceService = game:GetService("MarketplaceService")
local function info()
	local success, m = pcall(function()
		return MarketPlaceService:GetProductInfo(16206974643, 2)
	end)	
	
	if success and m then
		local id = 16206974643
		local gamepassname = m.Name
		local price = m.PriceInRobux
		local desc = m.Description
		local imgid = m.IconImageAssetId

		return {id=id, Name=gamepassname, price=price, desc=desc, imgid="rbxassetid://"..tostring(imgid)}
	else
		--warn(err)
		return{id=0, Name="Error", price=0, desc="Error", imgid="rbxassetid://"..tostring(119971175)}
	end
	
end

image

Please help me thanks

There’s nothing wrong with the code. The issue is with the ID you are giving it:
https://www.roblox.com/game-pass/16206974643/

1 Like

It’s not 2, but rather an Enum Infotype. So Enum.InfoType.Gamepass

You can put either the enum itself, or the value.


2 corresponds with Enum.InfoType.Gamepass

umm when i pressed the copy asset id from studio it coppied a code but now when i press it, it gives me a diffrent code that works from some reason

Thanks for the help

copy asset id

There’s a seperate enum for assets, so it may have worked if you put 0 in it instead of 2. Its better to get the actual gamepass ID though.

1 Like

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