If you enter this link: https://www.roblox.com/place-thumbnails?params=[{placeId:914206360}] you end up on a page on which some values are listed. I would like to know how to use these values in roblox (I would like to get the thumbnailUrl)
You probably shouldn't use "advanced image endpoints". HTTP would be more effecient in this case.
Roblox has an API for this, the HttpService (click here for more info).
Don't forget to enable it though:
HttpService starts off as disabled by default.
To enable HTTP requests, the HttpService must be enabled through Studio’s Game Settings by opening the game’s settings via the Game Settings button on the Home tab of the game’s studio window
You can get it through the GetService()
method:
local httpService = game:GetService("HttpService")
This allows you to make HTTP requests such as GET and POST. In this case you would use GET to access content. HttpService has a method GetAsync(url)
which does just this and accepts url
as it's first argument. It returns a string of the response, but it would be really tiresome to use string searches to get specific parts of the response. Since the response in your case would be a JSON table, you would use HttpService's JSONDecode(json)
to decode the JSON to a Lua table for easier accessiblity.
One problem though, any url with the Roblox domain (roblox.com) with throw a "Trust Check Error" (why? well so Roblox doesn't get DDoS'd by their own servers lol). In order to do this we would need to use a proxy, there is a free Roblox proxy you can use: rprxy.xyz, just replace www.roblox.com with rprxy.xyz.
Here's what the full thing might look like:
local httpService = game:GetService("HttpService") -- retrieve api service local url = "https://rprxy.xyz/place-thumbnails?params=[{placeId:914206360}]" -- url to use HTTP requests local httpResponse = httpService:GetAsync(url) -- HTTP GET method local decodedData = httpService:JSONDecode(httpResponse) -- returns Lua table -- finally, do whatever you want with the data for k, v in pairs(decodedData[1]) do print(k, ":", v) end