IPv6 Lookup API
The same lookup as IPv4, for IPv6 addresses, with one extra field: the announced prefix the address belongs to. Around half of the traffic to consumer websites now arrives over IPv6, and a lookup that only knows about IPv4 leaves those visitors unplaced.
Example
$ curl "https://api.mygeocode.com/v1/ipv6?ip=2001:4860:4860::8888"
# The caller's own address, if the request arrived over IPv6
$ curl "https://api.mygeocode.com/v1/ipv6"Any textual form is accepted: compressed with ::, fully expanded, with a zone suffix (which is ignored), or an IPv4-mapped address like ::ffff:8.8.8.8, which is answered with IPv4 data and version: 4.
If you call this endpoint without ip over an IPv4 connection, you get the IPv4 result rather than an error.
{
"status": "ok",
"ip": "2001:4860:4860::8888",
"version": 6,
"prefix": "2001:4860::/32",
"country": "United States",
"country_code": "US",
"region": "California",
"region_code": "CA",
"city": "Mountain View",
"postcode": "94043",
"lat": 37.4056,
"lon": -122.0775,
"timezone": "America/Los_Angeles",
"asn": 15169,
"org": "Google LLC",
"is_datacenter": true,
"is_proxy": false
}What you get back
All the fields of the IPv4 lookup, plus:
| Field | Meaning |
|---|---|
prefix | The route announced in BGP that contains this address, in CIDR form. Useful for grouping addresses by network and for understanding why two addresses that look different resolve to the same place. |
version | 6, or 4 for an IPv4-mapped address. |
A note on the free tier and IPv6
Anonymous usage of every endpoint is counted per IPv6 /40 block rather than per address, because one customer commonly holds a /64 or /56 and could otherwise rotate through addresses indefinitely. If you are on a large shared allocation, such as some cloud providers, and find the free tier used up by neighbours, attach an API key or whitelist your addresses so your usage is counted on your own account. See rate limits.
Price and limits
One call, one request; batches count per address. 2,500 a day free, then credits at $0.001 per request or €50 a month unlimited. Pricing. The ip-api, ipinfo and ipstack drop-in hosts accept IPv6 addresses too.