What do you want to achieve? Keep it simple and clear!
I want to obtain amount of visits of game in roblox by Id. So I’m getting place in roblox by MarketPlaceService:GetProduct info, then I check if this product asset type is place. But place info doesn’t have such information, thats why I’m doing this post and because I didn’t found any post about this in devforum.
local HttpService = game:GetService("HttpService");
local Response = HttpService:RequestAsync({
Method = "GET";
Url = string.format("https://games.rprxy.xyz/v1/games?universeIds=%d", game.GameId); --// Send to the rprxy.xyz proxy with the current game's id
});
if (Response.Success and Response.Body) then --// If it succeeded, returned a status code of 200-299, and gave a Body
local Body = HttpService:JSONDecode(Response.Body) --// Turn the JSON string into a Lua table
if (Body.data[1]) then --// If we got data for our game
local Visits = Body.data[1].visits;
--// Logic for using the Visits would go here
end
end
local function GetVisits(Id: number)
local gameRequest = `https://games.roproxy.com/v1/games?universeIds={Id}`
local succes, result = pcall(function()
return HttpService:GetAsync(gameRequest)
end)
if succes then
local Visit = HttpService:JSONDecode(result).data[1].visits
return Visit
end
end