Hello, I have been developing a game and I’m wondering how I could get a game’s icon from its Universe Id.
I am unable to use place Id as the api I am using returns the Universe Id of experiences and when I’ve tried using it in my script to obtain the icon; however, it has not worked.
I am currently using this script to obtain the game icon (only works using place id):
local MP = game:GetService('MarketplaceService')
local success, Info = pcall(function()
return MP:GetProductInfo(experience["id"])
end)
if success and Info then
ImageLabel.Image = "rbxassetid://" .. Info.IconImageAssetId
end
Note: I cannot usegame.PlaceIdas the system need to work for external games by different creators,
If you know of any solutions, please take a moment to reply.
local HttpService = game:GetService('HttpService')
local MarketplaceService = game:GetService('MarketplaceService')
local universeId = "YourUniverseIdHere" -- Replace with your Universe ID
local url = "https://thumbnails.roblox.com/v1/games/icons?universeIds=" .. universeId .. "&size=150x150&format=Png&isCircular=false"
local success, response = pcall(function()
return HttpService:GetAsync(url)
end)
if success then
local data = HttpService:JSONDecode(response)
if data and data.data and #data.data > 0 then
local iconUrl = data.data[1].imageUrl
local success, Info = pcall(function()
return MarketplaceService:GetProductInfo(universeId, Enum.InfoType.Asset)
end)
if success and Info then
ImageLabel.Image = iconUrl
end
end
end
remember to enable http services in ur game to use it. request more if issues persist