# IPv6 coverage

> Full dual-stack parity across IPv4 and IPv6 in the REST API and every database format.

IPv6 is a first-class citizen across IPScope. Every API endpoint and every downloadable `.mmdb`, `.csv.gz`, and `.parquet` snapshot contains both IPv4 and IPv6 routing trees in a single unified dataset.

## Formatting IPv6 addresses

The REST API accepts any valid RFC 4291 / RFC 5952 representation (compressed or full) and returns the canonical compressed form in `ip`:

```json 200 OK (IPv6)
{
  "ip": "2606:4700:4700::1111",
  "ip_version": 6,
  "matched_network": "2606:4700:4700::/48",
  "geo": {
    "country_code": "US",
    "declared_country_code": "US",
    "physical_country_code": "US",
    "is_virtual_location": false,
    "location_type": "anycast",
    "confidence": 0.89
  },
  "network": {
    "asn": 13335,
    "organization": "Cloudflare, Inc."
  }
}
```

## Prefix aggregation

- End-user residential allocations are typically indexed at `/48` or `/56`; mobile carrier pools at `/48` or `/64`.
- Lookups always match the most specific routed prefix (`matched_network`) in the radix tree.
- In `.mmdb`, `.csv.gz`, and `.parquet` editions, IPv4 and IPv6 share the exact same schema and file, with no separate `-ipv6` files to manage.
