Is there a reliable web-service that provides an API to turn an IP address into a location, i.e. city, region, country
. Willing to pay, but need something solid and reliable.

- 42,716
- 77
- 201
- 296
-
For a list of all free IP lookup services, you can refer to my answer for http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript – thdoan Feb 01 '16 at 04:56
6 Answers
My service, http://ipinfo.io includes location information, hostname, network owner and some other details:
$ curl ipinfo.io/8.8.8.8
{
"ip": "8.8.8.8",
"hostname": "google-public-dns-a.google.com",
"loc": "37.385999999999996,-122.0838",
"org": "AS15169 Google Inc.",
"city": "Mountain View",
"region": "CA",
"country": "US",
"phone": 650
}
Here's a PHP example:
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
echo $details->city; // -> "Mountain View"

- 17,187
- 8
- 87
- 103
-
Great tool! Ideal for me, free and no additional requirements like "special note on my own website". Thanks dude! ;) – Piotr Apr 17 '14 at 10:31
-
-
i found these free Geo-Ip services:
These are two very fast demo-installations (mine):
http://bric.lepus.uberspace.de:61165
https://oo.bootes.uberspace.de
please contact the me, if you like to implement the service long-term.

- 610
- 6
- 16
Depending on how much information you want returned back to you and the amount of traffic you're getting. You can use the free services provided by Maxmind GeoIPCityLite, FreeGeoIP is pretty good and ipinfodb..
I'm starting my own GeoIP Service called http://www.snoopi.io if you want to give it a try.

- 13
- 3
About ipinfo.io, it's not complete free! Check it:
"You are limited to 1,000 API requests per day. If you need to make more requests, or need SSL support, see our paid plans."

- 371
- 1
- 6
- 16
-
1Yeah. It was at the time. I've updated the other answer to remove that. – Ben Dowling Mar 24 '14 at 16:44
-
2It isn't really an answer - it should have been a comment on the other answer. – Ben Dowling Mar 25 '14 at 02:21
I can personally (due to my company) suggest Netacuity - it's really reliable (and I would like to underline really), but I don't know if they offer an API (or you need to download/update manually).
Alternatively, you could have a look at Maxmind, the "tool" behind FreeGeoIp.net (that is using Maxmind's GeoLite2), just more precise, with more data, and costing 0.01$ per request or so - the good thing is that you can cache the results.

- 4,480
- 1
- 27
- 39
http://www.ipinfodb.com has free geolocation API. It has rate limit at 2 queries per second.
http://api.ipinfodb.com/v3/ip-city/?key=your_api_key&ip=74.125.45.100

- 1,410
- 1
- 9
- 20