Skip to main content

IP Special-Purpose Ranges API

REAL DATA

Browse IANA IPv4 and IPv6 special-purpose registries or classify an address with deterministic most-specific-prefix matching.

Authoritative reference data or standards computation

Base URL
/api/ip-special-ranges
Capabilities
2 routes
Last updated
July 29, 2026
Data source

GET /api/ip-special-ranges

Live requestRuns against the public API
No key required
GET/api/ip-special-ranges?family=ipv4&search=documentation

Request parameters

Return both registries or only one address family.

Keep rows whose IANA Globally Reachable value exactly equals this boolean; null rows do not match.

Keep rows whose IANA Forwardable value exactly equals this boolean; null rows do not match.

Case-insensitive substring search across CIDR, IANA name and reference.

Advanced response options6 options

Limit the number of returned records (1–100). Defaults to all matches.

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/ip-special-ranges?family=ipv4&search=documentation"
const res = await fetch("https://randomapi.dev/api/ip-special-ranges?family=ipv4&search=documentation");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/ip-special-ranges?family=ipv4&search=documentation").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/ip-special-ranges?family=ipv4&search=documentation"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 4
family enum

Return both registries or only one address family.

default: any
allowed: any | ipv4 | ipv6
example: family=ipv4
globallyReachable boolean

Keep rows whose IANA Globally Reachable value exactly equals this boolean; null rows do not match.

example: globallyReachable=false
forwardable boolean

Keep rows whose IANA Forwardable value exactly equals this boolean; null rows do not match.

example: forwardable=true
search string

Case-insensitive substring search across CIDR, IANA name and reference.

allowed: 1 – 80
example: search=documentation
Universal parameters Shared response and formatting options 6
count int

Limit the number of returned records (1–100). Defaults to all matches.

default: all matches
allowed: 1 – 100
example: count=3
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=family,cidr
exclude list

Return all fields except these (comma-separated).

example: exclude=reservedByProtocol
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 11
family integer (4 | 6)

Address family: 4 for IPv4 or 6 for IPv6.

example: 4

cidr string

Special-purpose address block registered by IANA.

example: 192.0.2.0/24

name string

IANA designation for the block.

example: Documentation (TEST-NET-1)

reference string

RFC or other reference cited by the IANA registry.

example: [RFC5737]

allocationDate string (YYYY-MM)

Allocation month as published by IANA.

example: 2010-01

terminationDate string (YYYY-MM) nullable

Termination month for historical entries, or null when none is published.

example: null

source boolean nullable

IANA Source attribute; null represents a blank or N/A registry cell.

example: false

destination boolean nullable

IANA Destination attribute; null represents a blank or N/A registry cell.

example: false

forwardable boolean nullable

IANA Forwardable attribute; null represents a blank or N/A registry cell.

example: false

globallyReachable boolean nullable

IANA Globally Reachable attribute; null represents a blank or N/A registry cell.

example: false

reservedByProtocol boolean nullable

IANA Reserved-by-Protocol attribute; null represents a blank or N/A registry cell.

example: false

Documented examples

Build-generated requests and complete responses
3
IPv4 documentation and test blocks
GET /api/ip-special-ranges?family=ipv4&search=documentation
{
  "data": [
    {
      "family": 4,
      "cidr": "192.0.2.0/24",
      "name": "Documentation (TEST-NET-1)",
      "reference": "[RFC5737]",
      "allocationDate": "2010-01",
      "terminationDate": null,
      "source": false,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": false
    },
    {
      "family": 4,
      "cidr": "198.51.100.0/24",
      "name": "Documentation (TEST-NET-2)",
      "reference": "[RFC5737]",
      "allocationDate": "2010-01",
      "terminationDate": null,
      "source": false,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": false
    },
    {
      "family": 4,
      "cidr": "203.0.113.0/24",
      "name": "Documentation (TEST-NET-3)",
      "reference": "[RFC5737]",
      "allocationDate": "2010-01",
      "terminationDate": null,
      "source": false,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": false"generatedAt": "2026-07-29T08:14:28.000Z"
  }
}
Forwardable but not globally reachable ranges
GET /api/ip-special-ranges?forwardable=true&globallyReachable=false
{
  "data": [
    {
      "family": 4,
      "cidr": "10.0.0.0/8",
      "name": "Private-Use",
      "reference": "[RFC1918]",
      "allocationDate": "1996-02",
      "terminationDate": null,
      "source": true,
      "destination": true,
      "forwardable": true,
      "globallyReachable": false,
      "reservedByProtocol": false
    },
    {
      "family": 4,
      "cidr": "100.64.0.0/10",
      "name": "Shared Address Space",
      "reference": "[RFC6598]",
      "allocationDate": "2012-04",
      "terminationDate": null,
      "source": true,
      "destination": true,
      "forwardable": true,
      "globallyReachable": false,
      "reservedByProtocol": false
    },
    {
      "family": 4,
      "cidr": "172.16.0.0/12",
      "name": "Private-Use",
      "reference": "[RFC1918]",
      "allocationDate": "1996-02",
      "terminationDate": null,
      "source": true,
      "destination": true,
      "forwardable": true,
      "globallyReachable": false,
      "reservedByProtocol": false"generatedAt": "2026-07-29T08:14:28.000Z"
  }
}
The complete pinned registry
GET /api/ip-special-ranges?family=any&count=100
{
  "data": [
    {
      "family": 4,
      "cidr": "0.0.0.0/8",
      "name": "\"This network\"",
      "reference": "[RFC791], Section 3.2",
      "allocationDate": "1981-09",
      "terminationDate": null,
      "source": true,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": true
    },
    {
      "family": 4,
      "cidr": "0.0.0.0/32",
      "name": "\"This host on this network\"",
      "reference": "[RFC1122], Section 3.2.1.3",
      "allocationDate": "1981-09",
      "terminationDate": null,
      "source": true,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": true
    },
    {
      "family": 4,
      "cidr": "10.0.0.0/8",
      "name": "Private-Use",
      "reference": "[RFC1918]",
      "allocationDate": "1996-02",
      "terminationDate": null,
      "source": true,
      "destination": true,
      "forwardable": true,
      "globallyReachable": false,
      "reservedByProtocol": false"generatedAt": "2026-07-29T08:14:28.000Z"
  }
}

GET /api/ip-special-ranges/classify

Live requestRuns against the public API
No key required
GET/api/ip-special-ranges/classify?ip=192.0.0.9

Request parameters

Strict IPv4 or IPv6 address. Output and meta.params use canonical notation.

Advanced response options4 options

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/ip-special-ranges/classify?ip=192.0.0.9"
const res = await fetch("https://randomapi.dev/api/ip-special-ranges/classify?ip=192.0.0.9");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/ip-special-ranges/classify?ip=192.0.0.9").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/ip-special-ranges/classify?ip=192.0.0.9"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 1
ip string required

Strict IPv4 or IPv6 address. Output and meta.params use canonical notation.

allowed: 2 – 45
example: ip=192.0.0.9
Universal parameters Shared response and formatting options 4
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=ip,family
exclude list

Return all fields except these (comma-separated).

example: exclude=registryVersion
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 6
ip string (IP address)

Canonical address that was classified.

example: 192.0.0.9

family integer (4 | 6)

Detected IP address family.

example: 4

isSpecialPurpose boolean

Whether at least one IANA special-purpose block contains the address.

example: true

mostSpecific object nullable

Longest-prefix matching IANA row, or null when none matches.

example: {"cidr":"192.0.0.9/32","name":"Port Control Protocol Anycast"}

matches object[]

All containing IANA rows in longest-prefix order.

example: [{"cidr":"192.0.0.9/32"},{"cidr":"192.0.0.0/24"}]

registryVersion string (date)

Pinned IANA registry snapshot used for classification.

example: 2025-10-09

Documented examples

Build-generated requests and complete responses
3
Resolve overlapping IPv4 protocol ranges
GET /api/ip-special-ranges/classify?ip=192.0.0.9
{
  "data": {
    "ip": "192.0.0.9",
    "family": 4,
    "isSpecialPurpose": true,
    "mostSpecific": {
      "family": 4,
      "cidr": "192.0.0.9/32",
      "name": "Port Control Protocol Anycast",
      "reference": "[RFC7723]",
      "allocationDate": "2015-10",
      "terminationDate": null,
      "source": true,
      "destination": true,
      "forwardable": true,
      "globallyReachable": true,
      "reservedByProtocol": false
    },
    "matches": [
      {
        "family": 4,
        "cidr": "192.0.0.9/32",
        "name": "Port Control Protocol Anycast",
        "reference": "[RFC7723]",
        "allocationDate": "2015-10",
        "terminationDate": null,
        "source": true,
        "destination": true,
        "forwardable": true,
        "globallyReachable": true,
        "reservedByProtocol": false
      },
      {
        "family": 4,
        "cidr": "192.0.0.0/24",
        "name": "IETF Protocol Assignments",
        "reference": "[RFC6890], Section 2.1",
        "allocationDate": "2010-01",
        "terminationDate": null,
        "source": false,
    …
    "generatedAt": "2026-07-29T08:14:28.000Z"
  }
}
Classify an IPv6 documentation address
GET /api/ip-special-ranges/classify?ip=2001%3Adb8%3A%3A42
{
  "data": {
    "ip": "2001:db8::42",
    "family": 6,
    "isSpecialPurpose": true,
    "mostSpecific": {
      "family": 6,
      "cidr": "2001:db8::/32",
      "name": "Documentation",
      "reference": "[RFC3849]",
      "allocationDate": "2004-07",
      "terminationDate": null,
      "source": false,
      "destination": false,
      "forwardable": false,
      "globallyReachable": false,
      "reservedByProtocol": false
    },
    "matches": [
      {
        "family": 6,
        "cidr": "2001:db8::/32",
        "name": "Documentation",
        "reference": "[RFC3849]",
        "allocationDate": "2004-07",
        "terminationDate": null,
        "source": false,
        "destination": false,
        "forwardable": false,
        "globallyReachable": false,
        "reservedByProtocol": false
      }
    ],
    "registryVersion": "2025-10-09"
  },
  "meta": {
    "endpoint": "ip-special-ranges",
    "route": "/classify",
    "params": {
      "ip": "2001:db8::42"
    },
    "generatedAt": "2026-07-29T08:14:28.000Z"
  }
}
Confirm an ordinary global address has no match
GET /api/ip-special-ranges/classify?ip=8.8.8.8
{
  "data": {
    "ip": "8.8.8.8",
    "family": 4,
    "isSpecialPurpose": false,
    "mostSpecific": null,
    "matches": [],
    "registryVersion": "2025-10-09"
  },
  "meta": {
    "endpoint": "ip-special-ranges",
    "route": "/classify",
    "params": {
      "ip": "8.8.8.8"
    },
    "generatedAt": "2026-07-29T08:14:28.000Z"
  }
}

About this API

Coverage & behavior

A pinned, build-time snapshot of both IANA Special-Purpose Address Registries. Each row preserves IANA's source, destination, forwardable, globally reachable and reserved-by-protocol flags; a null flag means the source registry published a blank or N/A value, not false.

The classification route parses IPv4 and IPv6 strictly, finds every containing IANA block and orders overlaps by longest prefix first. mostSpecific is therefore deterministic: 192.0.0.9 resolves to its /32 entry ahead of the containing /24. Ordinary addresses return isSpecialPurpose: false, a null most-specific record and an empty matches list.

Data is never fetched during a request. The checked-in snapshot is versioned 2025-10-09; its two raw IANA feeds are SHA-256 pinned and regenerated by a deterministic parity script. Historical rows retained by IANA remain visible with their termination date.

Use it for

  • Classify client addresses before displaying them in network tooling
  • Build validators for private, documentation, loopback and protocol-specific space
  • Audit firewall rules against the exact IANA source and reachability flags

Frequently asked questions

How are overlapping special-purpose IP ranges classified?

Every containing IANA block is returned in longest-prefix order, and mostSpecific is the first one. Source order breaks ties deterministically.

Does a null reachability flag mean false?

No. Null preserves an IANA blank or N/A cell; it is kept distinct from an explicit false value.

Does this API fetch the IANA registry for every request?

No. It serves the SHA-256-pinned 2025-10-09 snapshot checked into the Worker bundle, so requests are synchronous and reproducible.

Standards & references