Use ipinfo.io 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

JSONP

JSONP is also supported, which allows you to use ipinfo.io entirely in client-sde 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");

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.

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.

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.

Last 7 days, UTC

Average Latency
52ms

Average Uptime
100.0%

Current Status
Online

  • No information
  • Outage
  • Disruption
  • Normal
Average latency determined from Mashape to API Response time

Endpoints

HTTP 200 : Model GET/json
						{
  "ip": "54.204.209.194",
  "hostname": null,
  "city": "Seattle",
  "region": "Washington",
  "country": "US",
  "loc": "47.5839,-122.2995",
  "org": "AS14618 Amazon.com, Inc.",
  "postal": "98144",
  "phone": 206
}						
Full IP details

Consume this API completely for free!


By joining the mashape API marketplace you can start using IPInfo.io API today!

Login to your account or signup: Create Account

or
   Signup with GitHub

By signing up you agree to our terms of service.