Clicky

 _             _     _      _    _      _
(_)_ __    ___(_) __| | ___| | _(_) ___| | __
| | '_ \  / __| |/ _` |/ _ \ |/ / |/ __| |/ /
| | |_) | \__ \ | (_| |  __/   <| | (__|   <
|_| .__/  |___/_|\__,_|\___|_|\_\_|\___|_|\_\
  |_|
    

Make a Request with an IP Address

      
$ curl https://ipsidekick.com/17.142.160.59

{
  "ip":"17.142.160.59",
  "country": {
    "code":"US",
    "name":"United States"
  },
  "currency" : {
    "code" : "USD",
    "decimals" : 2,
    "name" : "US dollar"
   },
  "timezone": {
    "gmtOffset":"GMT-7:00",
    "name":"America/Los_Angeles"
  },
  "holiday":"Independence Day"
}
      
    

Autodetect IP Address from Request

      
$ curl https://ipsidekick.com/json

{
  "ip":"17.142.160.59",
  "country": {
    "code":"US",
    "name":"United States"
  },
  "currency" : {
    "code" : "USD",
    "decimals" : 2,
    "name" : "US dollar"
   },
  "timezone": {
    "gmtOffset":"GMT-7:00",
    "name":"America/Los_Angeles"
  },
  "holiday":"Independence Day"
}
      
    

Cross-Origin Resource Sharing (CORS)

We support CORS so you don't have to do anything special to access IP Sidekick with Javascript in a modern browser. You just make a request as if you were performing it against your own domain.

For example, with jQuery, you can do:

      
$.get("https://ipsidekick.com/json", function(response) {
  console.log(response.ip +
    " comes from " + response.country.name +
    " with " + response.timeZone.gmtOffset);
});
      
      

With plain Javascript, you can do:

      
var request = new XMLHttpRequest();
request.open("GET", "https://ipsidekick.com/json", true);
request.onload = function() {
  if (request.status == 200){
    const json = JSON.parse(request.responseText);
    console.log(json.ip +
      " comes from " + json.country.name +
      " with " + json.timeZone.gmtOffset);
  }
};
request.send();
      
      

Node.js/Javascript

Install the ipsidekick npm module.

HTML/Javascript Examples

We have complete JSFiddle examples including HTML and Javascript:

Spreadsheet Examples

If you want to use IP Sidekick from within spreadsheets:

PHP Example

If you want to use IP Sidekick with PHP:

Data Fields

ip

e.g. "17.142.160.59"

The IP address this result is for.

country.code

e.g. "US"

country.name

e.g. "United States"

currency.code

e.g. USD

currency.decimals

e.g. 2

currency.name

e.g. US dollar

timeZone.gmtOffset

e.g. "GMT-7:00"

timeZone.name

e.g. "America/Los_Angeles"

holiday

e.g. "Independence Day"

The national public holiday at this location. This field only appears when there is a value available.