freegeoip.net Web Service





Usage

Querying the web service very is simple. Make HTTP GET requests to:

http://freegeoip.net/{format}/{ip_or_hostname}

Where format is one of the available formats (csv, xml or json - lower case). IP or host name is optional. It will search your IP if one is not provided.

JSON callbacks are supported by adding the callback argument to the query string:

http://freegeoip.net/json/google.com?callback=show

Results in:

show({"city": "Mountain View", "region_code": "CA", "region_name": "California", "metrocode": "807", "zipcode": "94043", "longitude": "-122.057", "country_name": "United States", "country_code": "US", "ip": "209.85.145.147", "latitude": "37.4192"});

About

The freegeoip.net offers a public RESTful Web Service for searching geolocation of IP addresses and host names.

This system has an internal database with geolocation information, which is queried via the web service. There's no magic or tricky calculations, it's a database. Thus, although it's very accurate, don't expect it to be perfect.

Originally, the database used by this system was provided by IPInfoDB, as an improved version of the free database provided by MaxMind. They are no longer distributing it for free.

The database was last updated in April 29, 2011

Limits

Due to the high volume of queries, we're implementing a throttling mechanism which allows at most 1000 queries per hour. After reaching this hourly quota, all of your requests will result in HTTP 403 (Forbidden) until it clears up on the next roll over.

There's absolutely no plans of selling services here. If this limit is a problem for you, please consider running your very own instance of this system. It's open source and freely available at GitHub.

Check out the source code

Contact

Feel free to share comments, suggestions or any other feedback. I'm here.