Authentication
Your API token is used to authenticate you with our API
Can be provided either as a bearer token or alternatively as a token URL parameter.
# With Bearer token
$ curl -H "Authorization: Bearer $TOKEN" https://api.ipinsight.io/ip/1.1.1.1
# With token query parameter
$ curl https://api.ipinsight.io/ip/8.8.8.8?token=$TOKEN
Rate Limits
Free usage of our API is limited to 1,000 API requests per day.
If you exceed that limit we'll return a 429 HTTP status code to you.
Paid plans come with higher daily limits.
HTTPS / SSL
Our API is available over a secure HTTPS connection for all users, even on the free plan.
Simply add https:// to the request URLs to make the requests secure.
# Get details for your own IP address over HTTPS
$ curl https://api.ipinsight.io/?token=$TOKEN
IP Address Parameter
The API supports passing in a single IPv4 or IPv6 IP address.
Alternatively if you do not pass in any IP address we'll return details for the calling address.
# Get details for 8.8.8.8
$ curl https://api.ipinsight.io/ip/8.8.8.8?token=$TOKEN
# Get details for 2001:250:200::
$ curl https://api.ipinsight.io/ip/2001:250:200::?token=$TOKEN
# Get details for your own IP address, which'll be included in the response
$ curl https://api.ipinsight.io/ip/?token=$TOKEN
JSONP/CORS Requests
JSONP and CORS are supported, allowing you to use api.ipinsight.io entirely in client-side code.
For JSONP you just need to specify the callback parameter.
$.get("https://api.ipinsight.io/ip/", function(response) {
console.log(response.ip, response.country_code);
}, "jsonp")
Response Objects
{
"ip": "210.50.194.172",
"is_european_union": true,
"idd_code": "61",
"country_code": "AU",
"country_name": "Australia",
"region_name": "Victoria",
"city_name": "Melbourne",
"latitude": -37.813627,
"longitude": 144.963057,
"timezone": {
"id": "Australia/Melbourne",
"current": "2019-09-25T16:39:27+10:00",
"gmt_offset": 36000,
"code": "AEST",
"is_daylight_saving": false
},
"currency": {
"code": "AUD",
"name": "Australian Dollar",
"symbol": "$"
},
"operator": {
"owner_domain": "",
"isp_domain": "iprimus.com.au"
},
"asn": {
"number": 9443,
"name": "INTERNETPRIMUS-AS-AP",
"organization": "Primus Telecommunications",
"desc": "INTERNETPRIMUS-AS-AP Primus Telecommunications, AU",
"route": "210.50.192.0/18"
}
}
Field | Description |
---|---|
ip | The IP address that was looked up. |
is_european_union | depending on whether the country is a recognized member of the European Union. |
idd_code | The International Calling Code for the country where the IP Address is located. |
country_code | The 2 letter ISO 3166-1 alpha-2 code for the country. |
country_name | The name of the country where the IP Address is located. |
region_name | The name of the region where the IP Address is located. |
city_name | The name of the city from where the IP Address is located. |
latitude | An approximate latitudinal location for the IP Address. Often near the center of city. |
longitude | An approximate longitudinal location for the IP Address. Often near the center of city. |
timezone->id | Timezone ID |
timezone->current | The exact current time in the Timezone the IP Address belongs to accounting for Daylight Savings. |
timezone->gmt_offset | The UTC offset of the Timezone |
timezone->code | The Abbreviation of the Timezone |
timezone->is_daylight_saving | depending on whether or not Daylight Savings have been accounted for. |
currency->code | The ISO 4217 currency code. |
currency->name | The name of the currency. |
currency->symbol | The symbol of the currency. |
operator->owner_domain | Owner domain for the IP Address. |
operator->isp_domain | ISP Domain for the IP Address. |
asn->number | The Autonomous System Number. |
asn->name | The name of the ASN |
asn->organization | organization that owns the ASN. |
asn->desc | The symbol of the currency. |
asn->route | The network prefix the IP Address belongs to. |