Skip to main content

IP Intelligence API

The IPLocate REST API provides comprehensive IP address geolocation and intelligence data.

Base URL
https://iplocate.io/api/

Look up an IP address

The main IPLocate API endpoint provides comprehensive information about any IP address, including geographic location, coordinates, postal code, timezone, currency code, calling code. This is sometimes called GeoIP data.

It also provides ASN (Autonomous System Number) details, IP to company information, privacy and threat information (VPN, proxy detection, Tor, relay, hosting, etc.), abuse contact information.

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

Parameters

ip
A single IPv4 or IPv6 IP address
Path parameter
include
Comma-separated list of fields to include in the response (optional). See filtering responses.
Query parameter

Response

The response is a JSON object with comprehensive data about the IP address.

{
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"is_eu": false,
"city": "Mountain View",
"continent": "North America",
"latitude": 37.38605,
"longitude": -122.08385,
"time_zone": "America/Los_Angeles",
"postal_code": "94035",
"subdivision": "California",
"currency_code": "USD",
"calling_code": "1",
"is_anycast": true,
"is_satellite": false,
"asn": {
"asn": "AS15169",
"route": "8.8.8.0/24",
"netname": "GOOGLE",
"name": "Google LLC",
"country_code": "US",
"domain": "google.com",
"type": "hosting",
"rir": "ARIN"
},
"privacy": {
"is_abuser": false,
"is_anonymous": true,
"is_bogon": false,
"is_hosting": true,
"is_icloud_relay": false,
"is_proxy": false,
"is_tor": false,
"is_vpn": true
},
"hosting": {
"provider": "Google Cloud",
"domain": "cloud.google.com",
"network": "8.8.8.0/24"
},
"company": {
"name": "Google LLC",
"domain": "google.com",
"country_code": "US",
"type": "hosting"
},
"abuse": {
"address": "1600 Amphitheatre Parkway, Mountain View, CA, 94043, US",
"country_code": "US",
"email": "[email protected]",
"name": "Google LLC",
"network": "8.8.8.0 - 8.8.8.255",
"phone": "+1-650-253-0000"
}
}

Data types

For a detailed list of returned data types, see the Data types page.

Look up your own IP address

If you don’t provide an ip parameter, the API will use the IP address of the sender.

This is useful for client-side applications that want to fetch data about the user without having to make a server-side call.

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

The response is the same as the Look up an IP address response format.

Filtering responses

You can filter API responses in two ways:

  • By URL path parameter (/api/lookup/8.8.8.8/country_code)
  • By include parameter (/api/lookup/8.8.8.8?include=country_code,country)

URL path parameter

This supports returning a single field or object.

If the field is a single value, it will be returned as plain text.

GET /api/lookup/:ip/:filter
curl "https://iplocate.io/api/lookup/8.8.8.8/country_code"
Response
US

If the field is an object, it will be returned as JSON. For example, to fetch ASN information:

GET /api/lookup/:ip/:filter
curl "https://iplocate.io/api/lookup/8.8.8.8/asn"
Response
{
"asn": "AS15169",
"route": "8.8.8.0/24",
"netname": "GOOGLE",
"name": "Google LLC",
"country_code": "US",
"domain": "google.com",
"type": "hosting",
"rir": "ARIN"
}

include parameter

The include query parameter supports a comma-separated list of fields to include in the response. It will always return JSON.

GET /api/lookup/:ip?include=field1,field2
curl "https://iplocate.io/api/lookup/8.8.8.8?include=country_code"
Response
{
"country_code": "US"
}

Object and nested fields can also be selected:

GET /api/lookup/:ip?include=field1,field2
curl "https://iplocate.io/api/lookup/8.8.8.8?include=country_code,asn,privacy.is_vpn"
Response
{
"country_code": "US",
"asn": {
"asn": "AS15169",
"route": "8.8.8.0/24",
"netname": "GOOGLE",
"name": "Google LLC",
"country_code": "US",
"domain": "google.com",
"type": "hosting",
"rir": "ARIN"
},
"privacy": {
"is_vpn": false
}
}