Way to get a asset display image using MarketPlaceService:GetProductInfo()?

Hello! I was wondering if there is a way to get an assets display image through MarketPlaceService:GetProductInfo()?

Example:

Problem being is I don’t think :GetProductInfo() returns it? Is there a way to get it?

Code:

HatsIDBox:GetPropertyChangedSignal('Text'):Connect(function()
	local Info = MarketPlaceService:GetProductInfo(HatsIDBox.Text)
	if Info then
		print(Info)
	end
end)

You can use AssetId to get the image, IconImageAssetId is the AssetId for gamepasses

1 Like

image

HatsIDBox:GetPropertyChangedSignal('Text'):Connect(function()
	local Info = MarketPlaceService:GetProductInfo(HatsIDBox.Text)
	if Info then
		HatsImage.Image = 'rbxassetid://'..Info.AssetId
	end
end)

AssetId isn’t the image though, that’s the catalog reference.

What you can do is use InsertService | Roblox Creator Documentation to insert the asset and add it to a ViewportFrame.

1 Like

Try this out

HatsIDBox:GetPropertyChangedSignal('Text'):Connect(function()
	local Info = MarketPlaceService:GetProductInfo(tonumber(HatsIDBox.Text))
	if Info then
		HatsImage.Image = "rbxthumb://type=Asset&id="..Info.AssetId.."&w=150&h=150"
	end
end)

@xZylter There was a similar question related to this and I mentioned about AssetId for the image and that got the solution, so I thnik it can be used for the image too

4 Likes

Oh, yes that works. Forgot about the rbxthumb URL.

1 Like

Thank you soo very much :pray:This was what I was looking for for the past 2 hours

2 Likes