I wanted to get a IP address from the front end devices. I found this free API called IPINFO.io
As per the documentation to get the IP address using Jquery all I need to do is:
$.get("https://ipinfo.io", function (response) {
console.log(response.ip)
}, "jsonp");
However, I get:
net::ERR_ABORTED 429
I am running this locally using Nodejs. The server does not matter because I am not sending a request to my Nodejs server.
However, if I paste the same code in a codepen with the same jquery version as the one that I have in my Nodejs project it runs just fine.
Why am I getting this error only when I use it over localhost?
IPinfo.io returns a 429 status if you've been rate limited. The unauthenticated API limits at 1,000 requests per day. See https://ipinfo.io/developers for more details. If you signup for a free account you'll get an access token you can use, and a limit of 50,000 requests per month.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With