So basically I want to make a gui that displays a multitude of servers running on a game/place so you can join that server with a click of a button; I also want it to show information about the server such as player count, etc. I don’t know how to go about making this so I’m posting here in hopes of help.
Any contributions are appreciated.
This might help
local http = game:GetService("HttpService")
local getAsync = http.GetAsync
local jsonDecode = http.JSONDecode
local serversUrl = "https://games.roproxy.com/v1/games/%s/servers/%s?limit=100&cursor=%s"
local function getServersRecursive(placeId, serverType, cursor, servers, tries)
placeId = placeId or game.PlaceId
serverType = serverType or "Public"
cursor = cursor or ""
servers = servers or {}
tries = tries or 5
if tries == 0 then return {} end
local requestUrl = serversUrl:format(placeId, serverType, cursor)
local success, result = pcall(getAsync, http, requestUrl)
if success then
if result then
local success2, result2 = pcall(jsonDecode, http, result)
if success2 then
if result2 then
for _, server in ipairs(result2.data) do
servers[server.id] = {
["maxPlayers"] = server.maxPlayers,
["totalPlayers"] = server.playing,
["fps"] = server.fps,
["ping"] = server.ping
}
end
cursor = result2.nextPageCursor
if cursor then
return getServersRecursive(placeId, serverType, cursor, servers, tries)
else
return servers
end
end
else
task.wait()
warn(result2)
tries -= 1
return getServersRecursive(placeId, serverType, cursor, servers, tries)
end
end
else
task.wait()
warn(result)
tries -= 1
return getServersRecursive(placeId, serverType, cursor, servers, tries)
end
end
local servers = getServersRecursive(1818)
for serverId, serverInfo in pairs(servers) do
print("ID: "..serverId)
print("Players: "..serverInfo.totalPlayers.."/"..serverInfo.maxPlayers)
print("FPS: "..serverInfo.fps)
print("Ping: "..serverInfo.ping)
print("")
end
The following API endpoint was used:
https://games.roblox.com/docs#!/GameInstances/get_v1_games_placeId_servers_serverType
Feel free to change, “1818” to a different place ID.
Output:

Wow! Thank you so much, this really helped me out.
While trying to do basically the same the OP, I’ve found this thread & your code. Upon giving it a shot, I’m turning over 403 Forbidden errors. Any ideas would could be causing that to turn out?
im having the same problem, kinda new to scripting and have no idea how half of this works. been browsing on more forums and i think its due to roproxy shutting down? then again i have no idea and im looking for a way to fix this
It’s because the url used isn’t available anymore, which is why it does this error.
Yes, I realized this over 3 years ago.
Thank you.
https://games.roblox.com/v1/games/1818/servers/0?sortOrder=2&excludeFullGames=false&limit=10
{
"previousPageCursor": null,
"nextPageCursor": null,
"data": [
{
"id": "08574121-3f08-4b7d-b8c4-e8fea8abd7ca",
"maxPlayers": 8,
"playing": 4,
"playerTokens": [
"95E91A92FD2095D791CE27749D3A6E3F",
"06947AE109A5F24F3CC647B1B497336B",
"7AC3EB1E41E7AEC7D7215DD113242ECE",
"4ECFDCD21912FB999CF74D7C566E55A5"
],
"players": [],
"fps": 59.974197,
"ping": 88
}
]
}
Just change the API arguments as needed.
When I try to use a proxy, (replace “roblox” with “roproxy”), the API returns an “HTTP 403” error; furthermore, if I make the request from a browser, it gets blocked
I tried running it in the studio and in the player, but it still doesn’t work. Why? Am I the only one facing this problem?
I also discovered that the description of this method is missing from the endpoints, as if it had simply been removed. Strange…
