Currently ip-api is free to use. I don’t know if I should get the priced version instead. We have a sizeable game and making a request on server creation sometimes does fail. Should I buy the 13.99 version instead?
Also with the rapid API one, it doesn’t return the correct location if I have a VPN on, whereas ip-api does.
It works completely right with VPN, a VPN will also affect the Roblox server location so you are getting a different server, however, I don’t own the API.
The ip-API is no longer free to use, unfortunately.
Very useful guide, thank you for updating it.
Although I do have a problem; rapidapi doesn’t give me any information about the city, it just returns nil for that specific value. It isn’t a huge issue (I’m just using the timezone instead) but I am curious if anyone else has a similar problem and if they managed to fix it.
Is this still relevant? I’ve been trying to activate it, but it keeps returning 403 (Forbidden) and I’ve tried to reiterate it through a loop however it’s still returning the same thing.
I’ve just tried to reuse your sample script and it does not print out the country. The API key is correct from what I know and so is the rapid api key.
EDIT: Sorry for the confusion-- I wasn’t subscribed
being a builder and trying to understand what is going on and trying to get this in my game is very hard.
first i have no idea where do i even put this script. i made my acc in the https://rapidapi.com website and it works there now how do i get the info to my game and also display it?
saw a person say to make a gui and then text label and in it a local script but what now? since my experience is basically 0 and can only read a script how do i go from here?
Head over the URL mentioned in the OP and then click on “Subscribe to test”, and then you get your details in the right-side code example, it might be node.js or any language, but it’s easy to read as the labels and their value is needed, which can be easily read from the code. or you can scroll down and read the parameters and you will get the values.
And after you get the values, you can simply check the code example, it would be hard to explain how to code here, because you need to know the basics in order for you to understand the code. But what it does is, it calls the API and then it will show the data in it simply.
Use “https://ipconfig.io/json” for getting location. it returns json code that you can access just like the tutorial, no api key required
(TESTED)(IN STUDIO)
local HttpService = game:GetService("HttpService")
pcall(function()
local response = HttpService:GetAsync("https://ipconfig.io/json")
if response then
local decodedResponse = HttpService:JSONDecode(response)
print(decodedResponse["country"])
else
print("Failed to fetch data")
end
end)
That api doesnt give as much info as the last api the OP posted but its still enough for a server display. Theres a ton of different formats but sticking with JSON would be wise.
Sometimes, the API fails to respond or the IP cannot be detected by the IPT framework of that host service, then the following will return “” or empty. This isn’t your script issue, it’s the host service or IPR or IP issue.
I’m pretty sure, the URL it redirects you is the API Page shown above. Make sure any VPN or any extension that blocks content on the website is disabled - the black canvas is most probably a result of the webpage not loading.