ipinfo.io


Developers

Use the ipinfo.io IP lookup API to quickly and simply integrate IP geolocation into your script or website. Save yourself the hassle of setting up local GeoIP libraries and having to remember to regularly update the data.

Full IP Details

When called from the command line or a script we will return a JSON response with all of the IP details that you see on the website. You can pass in the IP you're interested in, or ommit it to get details about your own IP.

$ curl ipinfo.io/8.8.8.8
{
  "ip": "8.8.8.8",
  "hostname": "google-public-dns-a.google.com",
  "loc": "37.385999999999996,-122.0838",
  "org": "AS15169 Google Inc.",
  "city": "Mountain View",
  "region": "California",
  "country": "US",
  "phone": 650
}

We do a little bit of magic on the server to determine if we should send the JSON response or the webpage. We usually get it right, but if you're seeing the webpage instead of the JSON (or want to check the JSON output in a browser) you can force the JSON response by adding /json to the end of the URL, eg:

http://ipinfo.io/json for your own IP

http://ipinfo.io/8.8.8.8/json for details on another IP

Specific fields

If you're only interested in specific details you can add a field to get a plain text response that includes just the field you're after.

$ curl ipinfo.io/8.8.8.8/org
AS15169 Google Inc.
$ curl ipinfo.io/8.8.8.8/city
Mountain View

You can also specify /geo to get just the geolocation information, which will often be faster than getting the full response.

$ curl ipinfo.io/8.8.8.8/geo
{
  "ip": "8.8.8.8",
  "loc": "37.385999999999996,-122.0838",
  "city": "Mountain View",
  "region": "California",
  "country": "US",
}

JSONP

JSONP is also supported, which allows you to use ipinfo.io entirely in client-side code. You just need to specify the callback parameter, eg. http://ipinfo.io/?callback=callback. Most javascript libraries will automatically handle this for you though. Here's a jQuery example that logs the client IP and country:

$.get("http://ipinfo.io", function(response) {
    console.log(response.ip, response.country);
}, "jsonp");

Rate limits

You are limited to 1,000 API requests per day. If you need to make more requests, or need SSL support, see our paid plans.

Additional IP information

We can provide additional information and services on a paid basis, including proxy detection, scraping prevention, and improved geolocation accuracy. Contact us for more details.

Data sources

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

Terms of use

This is all provided as-is, with no guarantees on availability or accuracy of the results. We'll certainly do our best to make the service highly-available though, and the results accurate. You can use it for any purpose. Attribution is not required, but is appreciated.