I am looking for an API that returns the URL of the thumbnail.
I have this API: https://www.roblox.com/asset-thumbnail/image?assetId=1970&width=768&height=432&format=png
but this returns image bytes.
(the reason I asked this question here is because I can't access the developer forums)
CodePudding user response:
See the docs for the Games API and the docs for the Thumbnails API.
The Thumbnail API thumbnails.roblox.com/v1/games/multiget/thumbnails?universeIds={universeID}
will give you the image urls you need. However, you'll need the universeId first. So follow these steps :
1) Convert PlaceID to UniverseID
If you only know the placeID (the number from the game URL), then you can use the https://games.roblox.com/v1/games/multiget-place-details
endpoint to get the universeID.
Let's use (Bee Swarm Simulator) as an example, whose placeID is 1537690962
https://games.roblox.com/v1/games/multiget-place-details?placeIds=1537690962
[
{
"placeId": 1537690962,
"name": "Bee Swarm Simulator",
"description": "Grow your own swarm of bees, collect pollen, and make honey in Bee Swarm Simulator! Meet friendly bears, complete their quests and get rewards! As your hive grows larger and larger, you can explore further up the mountain. Use your bees to defeat dangerous bugs and monsters. Look for treasures hidden around the map. Discover new types of bees, all with their own traits and personalities!\r\n\r\nJoin Bee Swarm Simulator Club for Honey, Treats and codes! https://www.roblox.com/groups/3982592\r\n\r\n\ud83e\uddf8 Bee Swarm Simulator toys are available now at Walmart Supercenters, Smyths Toys, and GameStop! Collect toy bees and hive slots to construct a real hive! There are also adorable plushies, bear action figures, and more!\r\n",
"sourceName": "Bee Swarm Simulator",
"sourceDescription": "Grow your own swarm of bees, collect pollen, and make honey in Bee Swarm Simulator! Meet friendly bears, complete their quests and get rewards! As your hive grows larger and larger, you can explore further up the mountain. Use your bees to defeat dangerous bugs and monsters. Look for treasures hidden around the map. Discover new types of bees, all with their own traits and personalities!\r\n\r\nJoin Bee Swarm Simulator Club for Honey, Treats and codes! https://www.roblox.com/groups/3982592\r\n\r\n\ud83e\uddf8 Bee Swarm Simulator toys are available now at Walmart Supercenters, Smyths Toys, and GameStop! Collect toy bees and hive slots to construct a real hive! There are also adorable plushies, bear action figures, and more!\r\n",
"url": "https://www.roblox.com/games/1537690962/Bee-Swarm-Simulator",
"builder": "Onett",
"builderId": 1912490,
"hasVerifiedBadge": false,
"isPlayable": true,
"reasonProhibited": "None",
"universeId": 601130232,
"universeRootPlaceId": 1537690962,
"price": 0,
"imageToken": "T_1537690962_3990"
}
]
And now we've got the universeID.
2) Get thumbnails
With the universeID, we can make the call to https://thumbnails.roblox.com/v1/games/multiget/thumbnails?universeIds={universeID}&size=768x432&format=Png&isCircular=false
{
"data": [
{
"universeId": 601130232,
"error": null,
"thumbnails": [
{
"targetId": 1538429222,
"state": "Completed",
"imageUrl": "https://tr.rbxcdn.com/7242c75dd5e18de97464e397164f6c68/768/432/Image/Png"
}
]
}
]
}
And now you've got the thumbnail url. Hope this helps.
CodePudding user response:
Im at school right now so I cant check but I think if you right click a image and open it in a new tab you can copy the URL at the top of the screen and that might work.