Inventory of IP geo location services - API & JSON
Introduction
After a long search and trying the APIs on the Internet, an overview of useful public sources has been created. I am particularly interested in an API that returns JSON-formatted data so that I can use it in Python programs. API key Most are free to use, some needs an API key. This is available after a free registration. These services have a limit to the number of calls per day or hour. The table below is optimized to view with Firefox. If you have installed a JSON plugin for Firefox, the data will be displayed as a clickable page. In some cases the url needs to hold the IP address and/or the API-key. All the sources have their api documented. Feel free to try them all. |
Usage examples
On my GitHub page you will find some useful examples of Linux bash scripts, which all need an API key. These will only work with your own API key. More geo ip scripts are available at GitHub. |
Resource |
API key required |
IP address required |
Remarks |
no |
yes |
Hard to read the JSON-formatted data, but the only reliable and official resource for IP address information. Provides you only country related information. Please take a look at my GitHub page to find some Python classes for RIPE and AirVPN. I also recommend to take a look at the ip-netblocks API at whoisxmlapi.com |
|
no |
no |
||
no |
no |
colored and formatted output with just curl -s http://ip-api.com try also http://ip-api.com/csv?fields=query |
|
no |
no |
||
no |
no |
my favorite api call just to retreive the public IP address to use it in various bash scripts as described below curl -s "http://ifconfig.co" (without json) |
|
no |
no |
||
no |
yes |
ipaddress=$(curl -s http://ifconfig.co) url=http://api.db-ip.com/v2/free/$ipaddress |
|
yes |
yes |
apikey="YOUR-APIKEY" ipaddress=$(curl -s "http://ifconfig.co") url="http://api.ipinfodb.com/v3/ip-country/?key=$apikey&ip=$ipaddress&format=json" |
|
no |
yes |
ipaddress=$(curl -s "http://ifconfig.co") url="http://api.ip2location.com/?key=demo&package=WS12&format=json&ip=$ipaddress" |
|
no |
yes |
||
no |
no |
A very useful resource, it's shows the JSON formatted data without the need for a plugin (mobile device). And very accurate too. For exampe: I live in a small town nearby a city. Most of the sources point to this larger city. But ipinfo.io is aware of the small town I live in, with accurate latitude&longitude details. |
|
yes |
no |
apikey="YOUR-APIKEY" url=http://api.ipstack.com/check?access_key=$apikey |
|
no |
no |
Value |
|
yes |
yes |
ipaddress=$(curl -s "http://ifconfig.co") apikey="YOUR-APIKEY" url="https://geoipify.whoisxmlapi.com/api/v1?apiKey=$apikey& ipAddress=$ipaddress" more APIs available like:
|
|
no |
no |
||
yes |
no |
apikey="YOUR-APIKEY" url="https://api.ipgeolocation.io/ipgeo?apiKey=$apikey" |
|
no |
no |
||
no |
no |
||
yes |
yes |
IPv6
These sites show the IPv6 address, only when IPv6 is enabled, otherwise an error will follow.
On StackExchange you can find an great overview with a lot of tips and tricks for IPv4 and IPv6.
update: 2020-03-02
These sites show the IPv6 address, only when IPv6 is enabled, otherwise an error will follow.
- whatismyipaddress.com
- ipv6-test.com
- api-ipv6.ip.sb/ip
- api6.ipify.org?format=json
- v6.ident.me/
- ip.seeip.org
On StackExchange you can find an great overview with a lot of tips and tricks for IPv4 and IPv6.
update: 2020-03-02