"HttpError: NetFail" when trying to get server region via HttpService

Is there no way to get accurate server country&city region anymore? i tried different built-in roblox studio ip apis like “https://ip-api.com/json/”, “http://ipconfig.io/json/” and even “https://ip-retrive.glitch.me/?gameid=” which all resulted in same “HttpError: NetFail” error in output.
im aware that there are external ip APIs but unfortunately im not planning on spending money just to get knowledge of temporary server’s location

Hello, Staplegun.

Could you please show your code? It seems to work for me.

My code:

function GetServerRegion()
	local http = game:GetService("HttpService")
	local serverinfo = http:JSONDecode(http:GetAsync("http://ip-api.com/json/"))
	return serverinfo
end

print(GetServerRegion())

Output value: Netherlands (relatively accurate)

my code isn’t the problem here, trust me

Make sure your game is published and has HTTP service enabled.

I’m pretty sure that api/url doesnt work for roblox, u have to use another one
or make your own. I had to make my own.

could you please tell me how did you make your own API if it isn’t a secret?

it is published, and i already had http service enabled in security tab. otherwise it would ask me to enable it in output as an error…

Have you tried it outside of studio? Maybe ask one of your friends to test it. It works fine for me.

1 Like