Getting started with IPLocate

Introduction

IPLocate provides a simple API to return data for IPv4 and IPv6 IP addresses - such as country, city, continent, timezone, and more.

IPLocate data is updated daily, using a combination of public and proprietary data sources. Thanks to our unique data sources, our API accuracy often exceeds other IP geolocation services like ipinfo, ipdata, and ipapi.

The API can also provide detailed ASN data, WHOIS data, and threat and privacy data. For example:

  • which organisation hosts the IP address
  • whether the IP address is a proxy or VPN
  • whether the IP address is abusive

We've already included your API key in the example snippets below. You can try them out as-is!

Log in or sign up to get your API key and try out the examples below.

Quick start

Start by signing up for a free API key.

We have client libraries for popular languages, so you can get started quickly.

Want to see a new language here, or developed your own integration? Let us know!

Curl

curl https://iplocate.io/api/lookup/8.8.8.8?apikey=YOUR_API_KEY

Node.js

const iplocate = require('node-iplocate');

iplocate('17.253.0.0', { api_key: "YOUR_API_KEY" }).then((results) => {
  console.log(results);
});

JavaScript using fetch

const response = await fetch('https://iplocate.io/api/lookup/17.253.0.0?apikey=YOUR_API_KEY');
const data = await response.json();

console.log(data);

Ruby

require 'iplocate'

results = IPLocate.lookup('17.253.0.0')

puts results.inspect

Python

import requests

ip = '17.253.0.0'
apiKey = 'YOUR_API_KEY'
url = f'https://iplocate.io/api/lookup/{ip}&apikey={apiKey}'

response = requests.get(url)
print(response.json())

PHP

<?php

$res = file_get_contents('https://iplocate.io/api/lookup/17.253.0.0?apikey=YOUR_API_KEY');
$res = json_decode($res);

var_dump($res);

Authentication and API limits

Sign up for a free API key for 1,000 requests per day. You can purchase a monthly or yearly subscription starting at $29/month for higher API limits.

If you don't include an API key, your IP address is limited to 50 requests per day.

Our API provides information about your rate limits in the response headers: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.

You can also view your current usage and quota in your account dashboard.

API response data

An example response from the API can be seen by using the tool on the home page, or below:

{
  "ip": "123.243.246.200",
  "country": "Australia",
  "country_code": "AU",
  "is_eu": false,
  "city": "Sydney",
  "continent": "Oceania",
  "latitude": -33.8672,
  "longitude": 151.1997,
  "time_zone": "Australia/Sydney",
  "postal_code": "2049",
  "subdivision": "New South Wales",
  "subdivision2": null,
  "network": "123.243.240.0/20",
  "asn": {
    "asn": "AS7545",
    "route": "123.243.246.0/24",
    "netname": "TPG-INTERNET-AP",
    "name": "TPG Telecom Limited",
    "country_code": "AU",
    "domain": "tpgtelecom.com.au",
    "type": "isp",
    "rir": "APNIC"
  },
  "privacy": {
    "is_abuser": false,
    "is_anonymous": false,
    "is_bogon": false,
    "is_datacenter": false,
    "is_icloud_relay": false,
    "is_proxy": false,
    "is_tor": false,
    "is_vpn": false
  },
  "company": {
    "name": "TPG Telecom",
    "domain": "www.tpgtelecom.com.au",
    "country_code": "AU",
    "type": "isp"
  },
  "abuse": {
    "address": "TPG Internet Pty Ltd., (Part of the Total Peripherals Group), 65 Waterloo Road, North Ryde NSW 2113",
    "email": "hostmaster@tpgtelecom.com.au",
    "name": "ABUSE TPGCOMAU",
    "network": "123.243.246.192 - 123.243.246.223",
    "phone": "+000000000"
  }
}

Base data Available in all plans

For fields that are not available, the value will usually be null. Depending on the data source, the field may be missing entirely, or may be an empty string (""). You should make sure your application handles each of these cases.

Key Description
ip The IP address
country The country name
country_code The ISO 3166-1 alpha-2 country code
is_eu Whether the IP address is in the European Union
currency_code The ISO 4217 currency code of the country
calling_code The country calling code of the country
city The city, if available
continent The continent
latitude The latitude
longitude The longitude
time_zone The tz database timezone identifier of the timezone at the location
postal_code The postal code
subdivision The subdivision (state, province, etc.), if available
subdivision2 Deprecated

The second-level subdivision (county, etc.), if available

This field is deprecated and will be removed. Use subdivision instead.

network Deprecated

The network range of the IP address

This field is deprecated and will be removed. Use asn.route instead.

ASN data Available in all plans

Key Description
asn.asn The ASN number
asn.route The network range of the ASN
asn.netname The name of the network
asn.name The name of the organisation
asn.country_code The ISO 3166-1 alpha-2 country code of the organisation
asn.domain The domain name of the organisation
asn.type The type of organisation. One of: business, hosting, government, education, isp, unknown
asn.rir The Regional Internet Registry (RIR) that assigned the ASN (for example: APNIC, ARIN, LACNIC, RIPE)

Privacy & threat data Available in all plans

Privacy and threat data provides detailed information about privacy services associated with the IP address (such as proxies, VPNs, iCloud Private Relay), as well as threat and security information like abuse and spam reports.

This data is updated multiple times per day from a combination of public and proprietary data sources.

Key Description
privacy.is_abuser true if the IP address has been reported as an abusive source (for example: spam, malware, etc.)
privacy.is_anonymous Convenience field that is true if either privacy.is_proxy or privacy.is_tor is true
privacy.is_bogon true if the IP address is a bogon IP address
privacy.is_hosting

true if the IP address belongs to a hosting provider (for example: Google Cloud, AWS, etc.).

If this is true, the top-level hosting object may contain more detailed information.

privacy.is_icloud_relay true if the IP address belongs to Apple's iCloud Relay service
privacy.is_proxy true if the IP address is a known proxy. IPLocate tracks millions of reported proxies. This data is updated multiple times per day.
privacy.is_tor true if the IP address is a known Tor exit node.
privacy.is_vpn true if the IP address is a known VPN. IPLocate tracks millions of actual VPN IP addresses. This data is updated multiple times per day.

Hosting data Available in all plans

Hosting data provides additional detailed information about the type of hosting service or datacenter the IP address belongs to. For example: AWS or Azure datacenter information.

{
  "hosting": {
    "provider": "Amazon AWS",
    "domain": "aws.amazon.com",
    "network": "3.5.140.0/22",
    "region": "ap-northeast-2",
    "service": "EC2"
  }
}
Key Description
hosting.provider The name of the hosting provider — for example: Amazon AWS
hosting.domain The domain name of the hosting provider — for example: amazonaws.com
hosting.network The network range of the hosting provider
hosting.region

The region code as given by the hosting provider — for example: us-east-1

This field will be populated for hosting providers that provide this information. Otherwise, it won't be in the hosting object.

hosting.service

The name of the service this IP address/network is used for, as given by the hosting provider — for example: EC2

This field will be populated for hosting providers that provide this information. Otherwise, it won't be in the hosting object.

Abuse contact data Available in all plans

Abuse contact data is contact information (usually of the network administrator) which can be used to report IP addresses that are engaged in fraudulent/malicious activites.

Key Description
abuse.address The physical address of the network abuse contact
abuse.country_code The ISO 3166-1 alpha-2 country code of the network abuse contact
abuse.email The email address of the network abuse contact
abuse.name The name of the network abuse contact
abuse.network The network range of the IP address
abuse.phone The phone number of the network abuse contact

Company data Available in all plans

Company data identifies the name of the organization behind the IP address, the type of business, and its domain name. We source this information from various publicly available datasets.

Key Description
company.name The name of the organization
company.domain The domain name of the organization
company.country_code The ISO 3166-1 alpha-2 country code of the organization
company.type The type of organization, based on a combination of network information and proprietary data. One of: business, hosting, government, education, isp, unknown

VPN data Available in all plans Coming soon

VPN data provides additional detailed information about the type of VPN or proxy service the IP address belongs to.

VPN data will be populated for IP addresses where privacy.is_vpn is true, and where we have additional data.

Note: VPN data is currently in beta. Contact us to get access.

Advanced usage

Look up your own IP address

If you don't provide an IP address, we'll provide the data for the IP address you're calling from. You could use this, for example, to fetch a client's IP address data directly from front-end code.

curl https://iplocate.io/api/lookup/?apikey=YOUR_API_KEY

With JSONP callback

curl https://iplocate.io/api/lookup/8.8.8.8/json?callback=my_javascript_function

With API key as header

curl --header "X-API-Key: YOUR_API_KEY" https://iplocate.io/api/lookup/8.8.8.8

Data corrections

We use a variety of public and proprietary data sources to provide the most accurate IP location data possible. However, if you find any inaccuracies, please contact us and we'll update our data as soon as possible.

We prefer a link to a hosted Geofeed, or a list of IP address data in Geofeed (RFC 8805) format.