15

What is the best way of geocoding IP addresses?

I have ~ 10,000 - 30,000 addresses to geocode once. The IP addresses are from all over the world and I only want the Long/Lat. Accuracy to the city level is not essential, but ideally it would be within 10-20 km.

Searching around I saw MaxMind which seems like a good option, but before I download and frequent myself with their API, are there any other recommended alternatives out there?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
djq
  • 16,297
  • 31
  • 110
  • 182

7 Answers7

9

I have heard about simplegeo api https://simplegeo.com/docs/api-endpoints/simplegeo-context May work for you

Jorge Vidinha
  • 1,507
  • 1
  • 13
  • 21
  • 2
    SimpleGeo shut down 4/1/2012. – runako Apr 01 '12 at 18:16
  • 1
    January 12th, 2012: After SimpleGeo was acquired by Urban Airship in Oct 2011, Urban Aiship said “wind down the availability of the current versions of [SimpleGeo's] Places, Context, and Storage over the next few months.”...The target date for pulling the plug officially will be March 31, 2012. Link – RyanKDalton Feb 07 '13 at 18:43
  • This link is giving a security warning. – PolyGeo Feb 08 '20 at 11:07
9

IPInfoDB can be used. They don't have a query limit, but they will throttle you to 1 response/sec if you request too frequently.

Alternately, if you feel like writing a little bit more code, you can download their database and run the batch queries yourself. I can't imagine it'd take long to set up, and it will process your 30k IP addresses quite quickly.

Sasa Ivetic
  • 5,190
  • 23
  • 22
5

google analytics has ip located on a map. I wonder if it could be found in codeplex anywhere?
geocoding-net having the GeoPluginIPGeoCoder();
Also mentioned an issue with the plugin and aquisition of the dat file from... not free geolitecity from Maxmind

Brad Nesom
  • 17,412
  • 2
  • 42
  • 68
3

If you don't want to lose time installing a database that will eat up your resources, you can use an online API. I am using http://www.ipgp.net/ip-address-geolocation-api/ and it let you to query up to 1m IP Addresses.

Lucian
  • 31
  • 1
1

I would say the best way is to use an online API. Managing a database on your end is a PAIN! Trust me, I've been there and IP locations change all the time so you'd have to update your database on the regular. With an online API they do all of that work for you.

I've been using an online API at https://www.zipcodeservices.com. I get 100,000 queries a year for $25.99 a month and not throttling of requests. It's pretty straight forward and is always up and working.

If I need more requests a year, they have different service plans that you could easily migrate up to.

KDDaDon
  • 11
  • 1
0

If you can quickly build your own database by sourcing freely available data then you can go with that option. The only downside is you will have to compromise on the accuracy of the database.

The other option, as presented by others, is using free/paid IP geolocation APIs. Since the time this question was posted, many new IP geolocation providers have emerged in the space to provide better IP geolocation APIs.

I would recommend trying out BigDataCloud's IP geolocation APIs which provides 10K per month for free without any limit on throttling. Their pricing per additional monthly 10K quotas is only $2.

Deep
  • 11
  • 4
0

For a one-time job maybe this bulk IP lookup service by whoisxmlapi can be good. It’s basically a simple GUI option that collects data from their database. I used it to look up around 45,000 IPs inputting a CSV file and it worked fine and spared the API setup. I believe the limit is 100K per query and you’ll need your IPs in a CSV file for geocoding. They claim to have good accuracy down to the city level and their data include long / lat (like many services out there in 2021). Note that it is a paid service if you need to look up more than 1000 addresses monthly.