Getting location of server via /v1/games/{placeId}/servers

I’m creating an auto-refreshing server list for my Discord server, and using this api to fetch the open servers.

I’m currently able to pull the FPS, ping, and player count. However, contrary to what I’ve seen other games do, I can’t find a way to get the location of the server.

The response body:

Games like custom duels have managed to also find the location of the server, hence:
image

Any advice on how to find the location would be appreciated. Thank you!

2 Likes

I think you would have to GET https://www.ip-api.com/json and send it to a repl.it project that you have that keeps track of the servers based on UUID, saving the data to a file as a dictionary. The discord bot could be run by the repl and use /v1/games/{placeId}/servers to fetch the UUIDs, then getting the information from the file.

You will have to enable HTTP requests.

If you don’t care about discord bots, then just send a GET inside of studio to the ip-api.com/json

How am I supposed to send an HTTP request via JavaScript on the Roblox server’s behalf? Are you suggesting I use long polling?

Just HttpService:GetAsync (roblox.com)

send one to the api, then JSONDecode() and store it as a variable
then you have to use HttpService:PostAsync (roblox.com) and store the information somewhere, I said repl.it as an example because you can also host a discord bot there

whenever the bot command is run, send a GET request in repl to get the roblox servers, and using the information stored, you can fetch the location of the roblox server

1 Like

I’m sorry for bumping but the solution is assuming that you own the game right? I’m currently trying to make a chrome extension that displays the ping on the server list. The ping didn’t work as what I intended it to be so I’m trying to get the server region, is there any solution to this at all if you don’t own the game?