Open Data Stack Exchange is a question and answer site for developers and researchers interested in open data. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for IP address to geocoding data sources and/or APIs. Open to any formats, and the main concern is the quality, depth, and freshness of the data.

share|improve this question
up vote 5 down vote accepted

There are three sources that may be helpful:

share|improve this answer
Interesting, but I don't think the Google Map API and IPInfoDB qualify as open data :-) – Nicolas Raoul May 26 '14 at 3:12
PInfoDB requires registration for use of the API, but for the same reasons many sites do in collecting metrics, rather than charging for the service. I included Google Map API only as a secondary component that may help @blunders to map the results of any earlier query. – Jeanne Holm May 26 '14 at 3:47
They seem (but I am not 100% sure) to use data from . These databases come either with a commercial license or with a free license. The free license says The LITE edition is an open-source version of database with limited accuracy & number of records compares to commercial release. It is free for personal or commercial use with attribution required. So I was wrong, IPInfoDB seems to qualify as open data indeed :-) – Nicolas Raoul May 26 '14 at 3:57

(Just to add details to the second list item in Jeanne's answer) is a community-built IP geocoding platform.

Database files are downloaded automatically by the updatedb script from the domain and according to their blog the data actually comes from the Geolite databases which are disctributed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.

In addition:

  • The engine itself is open source
  • There is even a free hosted API (with hourly limits)
share|improve this answer

Three more IP gelocation APIs/Datasets I can suggest: - free version for non-commercial use - crowdourced dataset and API - free IP geolocation dataset

share|improve this answer

For a project I use the GeoLite City download from MaxMind. The license is "Creative Commons Attribution-ShareAlike 3.0 Unported License."

This file is usually updated every month, so I have a script that checks if the file has been updated and only downloads/unzips if it has:

wget -N

I choose the binary file, and not the CSV, because there is a nice python library to load this data and then do the lookups: pygeoip. For thousands of IP addresses, I found this process much faster than sending each IP address to an external web API.

A python snippet to load the IP table and then do a lookup:

import pygeoip
gi = pygeoip.GeoIP('GeoLiteCity.dat')
print gi.record_by_addr('')

provides a JSON output like this:

 {'city': u'Mountain View', 'region_name': u'CA', 'area_code': 650, 'time_zone': 'America/Los_Angeles', 'dma_code': 807, 'metro_code': 'San Francisco, CA', 'country_code3': 'USA', 'latitude': 37.41919999999999, 'postal_code': u'94043', 'longitude': -122.0574, 'country_code': 'US', 'country_name': 'United States', 'continent': 'NA'}   
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.