Using API lookup, IP geolocation APIs can detect a user’s physical location. This enables functionality such as an e-commerce store able to detect a customer’s language and currency, or deliver marketing content exclusive to their market.
Alongside this, IP geolocation services can deliver additional features such as detecting common approaches by cybercriminals to circumvent the IP lookup. Cyber security needs to be treated with the utmost seriousness because it’s typically organized and fines under GDPR (the EU’s General Data Protection Regulation) can reach 4% of a company’s global revenue.
So, let’s focus on some of this functionality as we look at the 11 best IP geolocation APIs.
IP geolocation API from Abstract
IP address data is constantly being updated, so Abstract maintains long-standing relationships with internet service providers (ISPs) all over the world. This ensures that their IP Geolocation API remains capable of serving current needs. It supports IPv4 and IPv6 addresses and, being a REST API, is easy to implement in Python, Ruby, jQuery, PHP, and more. It can detect data including city, ZIP or postal code, latitude/longitude, and ASN (ISP). All data is encrypted using 256-bit SSL and can be exported in JSON or XML format.
All of its capabilities are available at all pricing levels, even if you’re using the free API key that can serve up to 20,000 API requests per month.
It’s also capable of sourcing threat data to help minimize your attack surface against cyber security threats. It’s able to detect proxies, VPNs (Virtual Private Networks) and TOR (anonymizer). These capabilities are also available at all price tiers.
DB-IP
The DB-IP geolocation API can detect data including continent code, country code, currency code, and ASN code. As a REST API, it’s easy to implement and the free trial doesn’t require an API key.
There are three versions of the API, each of which is segmented into ‘Starter’, ‘Premium’ and ‘Enterprise’ capabilities. Each tier makes more API calls and additional functionality available such as 99.99% uptime SLAs on the enterprise tier which is missing from the starter tier.
Threat detection capabilities include detection of VPNs, proxies and crawlers, all paired with a threat score.
ip2location
The IP2Location IP Geolocation Web Service can source a great deal of detail. Along with commonly available data including country, city and time zone, it can detect internet speed, elevation and the local weather station.
This granularity is sourced by purchasing credits which you can then spend to acquire the level of detail that you need. A variety of add-ons are also available.
It’s capable of detecting proxies, but full threat detection has been split into a separate product. So, to support some use cases, it might be necessary to acquire two ip2location products.
ipdata.co
ipdata is compatible with IPv4 and IPv6 addresses to source a visitor’s location. The data it can source includes country code, country flag, city, language, and currency.
The free plan is a free trial that can serve up to 1,500 API calls per month, useful for development purposes while implementing or very light, non-commercial use cases. The five paid tiers support many of the same functionality with the top two tiers adding more enterprise level features such as SLAs.
Threat detection is available at all paid tiers, enabling this API to detect TOR, proxy, BOGON (illegitimate IP addresses) and compare this data to known threats.
ipinfo.io
ipinfo can source location information including country, city, latitude/longitude, and the ISP abuse contact details. It can then export this data into JSON format.
The free trial is limited to 7 days and there’s also a free IP geolocation plan which enables up to 50,000 API calls per month.
In terms of threat detection, it’s capable of detecting TOR, VPNs, proxies, and more. However, this functionality is only made available at the second paid tier.
ipstack
ipstack’s API can source a user’s location down to ZIP code or postal code, latitude/longitude, currency symbol, and ASN data.
The ipstack website says the free API plan supports up to 100 API returns per month, but this may be an error as it’s a very low amount. It also only supports location data. Higher levels of data only become available in the four paid tiers.
This includes threat detection which becomes available in the third paid tier. It’s capable of detecting TOR, crawlers and proxies while comparing them to known threats.
Maxmind
Atypically, Maxmind pairs its real-time IP geolocation data from GeoIP2 Precision Services with confidence scores, accuracy radius and demographic data such as income in USD (but this is for US IP addresses only).
The free plan is limited to 5 US dollars’ worth of queries as you pay per API call with each call costing fractions of a cent (USD). Data more accurate than country requires the second paid tier. The additional data mentioned above only becomes available in the top tier.
TOR/VPN detection is also only available in the highest tier with full threat detection capabilities in a separate product.
ipgeolocation.io
ipgeolocation.io’s API can source visitor location data including country code, country name, phone calling code, time zone, and daylight savings time.
The free API can support up to 30,000 API returns per month with a 1,000 per day maximum. Beyond this are five paid tiers. The only thing that separates the tiers, though, is the number of API returns supported: all functionality is available at all levels including the free plan.
While all API endpoints support SSL for security, it’s unclear what threat detection capabilities are available.
Positionstack
Positionstack’s IP geolocation information includes dialing code, country code, country flat, and latitude/longitude. It supports real-time forward and reverse geocoding, and the data can be output in JSON, XML or GeoJSON.
Almost all features are available in the free plan which supports up to 25,000 API calls per month. HTTPS 256-bit encryption and the functionality to create embeddable maps are held back for the paid tiers which start at 9.99 USD per month.
Unfortunately, no information about threat detection data can be found on the website, so be prepared to contact Positionstack to learn more.
ipapi
ipapi can source a user’s geographical location, providing data that includes city, ZIP or postal code, currency, and connection information.
The free version supports up to 1,000 requests per month and is limited to location data. More data and HTTPS are introduced in a staggered way across the four paid tiers.
Unfortunately, the capability to detect proxies, crawlers, TOR and to carry out threat comparison only becomes available in the third paid tier.
ip-api
ip-api’s IP geolocation database is updated routinely to detect city, district, latitude/longitude, and connection type.
The free endpoint doesn’t even require an API key even though it appears to support all location data, but it isn’t for commercial use cases. Two paid tiers that add SSL encryption, SLAs and unlimited requests.
It can also detect proxies and hosting. It appears to be available at the free tier, but you should confirm with ip-api directly first.
Summary
As you can see from the IP geolocation APIs we’ve summarized, it’s rarely the level of data itself that distinguishes one API from another. Instead, it’s the pricing tier that this data is made available.
Ideally, you want as much information relevant to your use cases across as many tiers as possible. Otherwise, you could be sourcing not just more data, but API calls that you’ll never use.
Also, don’t forget threat data. In the era of GDPR, you need to make sure that the data you hold is kept safe.