Ipv4 http request always returns nil w/ unknown error?

So seemingly at random a few days ago, making httprequests to https://api4.my-ip.io/ip.json always returns nil, both in studio and in game.

Is this website rate limited or is something in my code (only showing what’s relevant) incorrect for making httprequests?

The warning of ipError is just “HttpError: Unknown”. It worked perfectly fine before for a couple weeks.
image

local http = game:GetService("HttpService")
local replicatedStorage = game:GetService("ReplicatedStorage")

local serverLocation = replicatedStorage.serverInfo:WaitForChild("serverLocation")

function GetServerRegion()
	local result

	local success,ipError = pcall(function()
		result = http:JSONDecode(http:GetAsync("https://api4.my-ip.io/ip.json"))
	end)
	
	if ipError then
		warn(ipError)
		serverLocation.Value = "Unknown"
		return
	end
end

GetServerRegion()

Solution: changing my request to http://ip-api.com/json/?fields=16394 seems to be a lot more reliable. Attempting to request from https://api4.my-ip.io/ip.json is throttled a majority of the time.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.