IPv6 lookup

The same lookup as IPv4 for IPv6 addresses, plus the announced prefix.

GEThttps://api.mygeocode.com/v1/ipv6

Parameters

ParameterTypeDescription
ipoptionalstringAn IPv6 address in any textual form. Default: the address the request came from.
ipsoptionalstringComma-separated addresses, up to 100. Each counts as one request.
langoptionalstringISO 639-1 code for names. Default en.
keyoptionalstringAPI key, if not sent as a header.

Example

$ curl "https://api.mygeocode.com/v1/ipv6?ip=2606:4700:4700::1111"
const url = new URL("https://api.mygeocode.com/v1/ipv6");
url.searchParams.set("ip", "2606:4700:4700::1111");
const geo = await (await fetch(url)).json();
console.log(geo.prefix, geo.country_code);
import requests

geo = requests.get("https://api.mygeocode.com/v1/ipv6", params={"ip": "2606:4700:4700::1111"}, timeout=5).json()
print(geo["prefix"], geo["country_code"])
Response
{
  "status": "ok",
  "ip": "2606:4700:4700::1111",
  "version": 6,
  "prefix": "2606:4700::/32",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "region_code": "CA",
  "city": "San Francisco",
  "postcode": "94107",
  "lat": 37.7621,
  "lon": -122.3971,
  "timezone": "America/Los_Angeles",
  "asn": 13335,
  "org": "Cloudflare, Inc.",
  "is_datacenter": true,
  "is_proxy": false,
  "is_private": false
}

Response fields

All fields of the IPv4 lookup, plus:

FieldTypeDescription
prefixstringThe BGP route containing the address, in CIDR notation.
versioninteger6, or 4 when an IPv4-mapped address (::ffff:a.b.c.d) was sent, in which case the answer is the IPv4 data.

Notes

Errors

400 invalid_request when ip is not a valid IPv6 address, or when ips has more than 100 entries.