ipdig.io

Fast IP Geolocation data API.

Free for non commercial use.

API Documentation Donate for 🌴⛱️

Getting Started

This very easy to use service. You request IP address as an argument in the url and get JSON formated results. Below is few examples in different languages. Current API endpoints are: ipdig.io/me, ipdig.io/{ip_address} and ipdig.io/{ip_address}/{field}.

You can format any query to be returned in more readable way. Just add ?pretty=1 to it.

# curl 'https://ipdig.io/1.1.1.1/?pretty=1'
{
  "city": "Research",
  "continent": "OC",
  "continent_full": "Oceania",
  "country": "AU",
  "country_full": "Australia",
  "ip": "1.1.1.1",
  "is_eu": "false",
  "loc": "-37.7000,145.1833",
  "organization": "Cloudflare Inc",
  "postal": "3095",
  "region": "Victoria"
}
# curl https://ipdig.io/me
{"city":"Vilnius","continent":"EU","continent_full":"Europe","country":"LT","country_full":"Republic of Lithuania","ip":"xxx.xxx.xxx.xxx","is_eu":"true","loc":"54.6973,25.2662","organization":"Telia Lietuva, AB","postal":"08106","region":"Vilnius"}
# curl https://ipdig.io/me/ip
xxx.xxx.xxx.xxx
# curl https://ipdig.io/1.1.1.1/organization
Cloudflare Inc

Example uses Python requests module (pip install requests).

import requests, json

ip_address = '1.1.1.1';
url = 'https://ipdig.io/' + ip_address;
data = requests.get(url)
result = data.json()

print(result['city'])
require 'open-uri'
require 'json'

ip_address = '1.1.1.1'
url = "https://ipdig.io/#{ip_address}"
data = open(url).read
result = JSON.parse(data)

puts result['city']
<?php
  $ip_address = '1.1.1.1';
  $url = "https://ipdig.io/" . $ip_address;
  $data = file_get_contents($url);
  $result = json_decode($data);

  echo $result->city;
?>

Example how to use it from JavaScript with a callback function like in this page above.

<script type="application/javascript">
  function myIP(json) {
    document.write(
    'Your IP: ' + json.ip + '<br />'
    +'Country: ' + json.country + '<br />'
    +'Continent: ' + json.continent_full + '<br />'
    +'Internet Provider: ' + json.organization + '<br />'
    )
  }
</script>
<script src="https://ipdig.io/me?callback=myIP"></script>