Skip to main content

IPv4 and IPv6

IPLocate and our APIs support both IPv4 and IPv6 addresses, providing comprehensive geolocation and intelligence data for all IP address types.

Read more about the difference between IPv4 and IPv6.

Calling the API

Our API endpoints are dual-stacked, meaning they handle connections from IPv4 and IPv6 addresses.

If you call our lookup endpoint without an IP address - for example, from client-side Javascript code - we’ll automatically detect the IP address of the caller. If the caller supports IPv6, the API will usually return data for their IPv6 address. This depends on the caller’s network configuration.

Supported IP address formats

IPv4 addresses

Standard dotted-decimal notation:

  • 192.168.1.1
  • 8.8.8.8
  • 172.16.0.1

IPv6 addresses

Full and compressed formats:

  • 2001:0db8:85a3:0000:0000:8a2e:0370:7334 (full)
  • 2001:db8:85a3::8a2e:370:7334 (compressed)
  • ::1 (loopback)
  • 2001:4860:4860::8888 (Google DNS)

API usage

Both IPv4 and IPv6 addresses work identically in the IPLocate API:

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

# IPv6 lookup
curl "https://iplocate.io/api/lookup/2001:4860:4860::8888?apikey=YOUR_API_KEY"

Batch processing

IPv4 and IPv6 addresses can be mixed in batch requests:

[
"8.8.8.8",
"2001:4860:4860::8888",
"1.1.1.1"
]

Examples

IPv4 response

{
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"is_eu": false
}

IPv6 response

{
"ip": "2001:4860:4860::8888",
"country": "United States",
"country_code": "US",
"is_eu": false
}