# IP Protocol Numbers API
> The IANA "Assigned Internet Protocol Numbers" registry as an API — the 8-bit value carried in the IPv4 Protocol field (and IPv6 Next Header) that identifies the encapsulated protocol. Resolve any number to its protocol (e.g. 6 → TCP, 17 → UDP, 1 → ICMP, 47 → GRE, 50 → ESP, 58 → IPv6-ICMP, 89 → OSPF, 132 → SCTP), look up by keyword, search by name, or list all 151 assigned protocols — each with its keyword, full name, IPv6-extension-header flag and defining RFC. Ideal for packet/firewall tooling, network analysis, NetFlow/IPFIX decoders and protocol documentation. (Distinct from transport-layer service port numbers.)

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/ipprotocols-api/..."
```

## Pricing
- **Free** (Free) — 25,000 calls/Mo, 2 req/s
- **Starter** ($2/Mo) — 200,000 calls/Mo, 8 req/s
- **Pro** ($5/Mo) — 900,000 calls/Mo, 20 req/s
- **Mega** ($14/Mo) — 4,500,000 calls/Mo, 50 req/s

## Endpoints

### IP Protocols

#### `GET /v1/list` — All protocol numbers

**Parameters:**
- `limit` (query, optional, string) — Max results (1-256, default 50) Example: `50`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ipprotocols-api/v1/list?limit=50&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "limit": 50,
        "total": 151,
        "offset": 0,
        "results": [
            {
                "name": "IPv6 Hop-by-Hop Option",
                "number": 0,
                "keyword": "HOPOPT",
                "reference": "[RFC8200]",
                "ipv6_extension_header": true
            },
            {
                "name": "Internet Control Message",
                "number": 1,
                "keyword": "ICMP",
                "reference": "[RFC792]",
                "ipv6_extension_header": false
            },
            {
                "name": "Internet Group Management",
                "number": 2,
                "keyword": "IGMP",
                "reference": "[RFC1112]",
                "ipv6_extension_header": false
            },
            {
                "name": "Gateway-to-Gateway",
                "number": 3,
                "keyword": "GGP",
                "reference": "[RFC823]",
                "ipv6_extension_header": false
            },
            {
                "name": "IPv4 encapsulation",
                "number": 4,
                "keyword": "IPv4",
                "reference": "[RFC2003]",
                "ipv6_extension_header": false
            },
            {
                "name": "Stream",
                "number": 5,
                "keyword": "ST",
                "reference": "[RFC1190][RFC1819]",
                "ipv6_extension_header": false
            },

…(truncated, see openapi.json for full schema)
```

#### `GET /v1/protocol` — A protocol by number or keyword

**Parameters:**
- `number` (query, optional, string) — Protocol number, e.g. 6 (TCP) Example: `6`
- `keyword` (query, optional, string) — Keyword, e.g. TCP

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ipprotocols-api/v1/protocol?number=6"
```

**Response:**
```json
{
    "data": {
        "name": "Transmission Control",
        "number": 6,
        "keyword": "TCP",
        "reference": "[RFC9293]",
        "ipv6_extension_header": false
    },
    "meta": {
        "timestamp": "2026-05-31T07:00:19.577Z",
        "request_id": "32d7e330-0e06-413b-9ad2-46787d60c531"
    },
    "status": "ok",
    "message": "Protocol retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search protocols by keyword or name

**Parameters:**
- `q` (query, required, string) — Search term, e.g. routing Example: `routing`
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ipprotocols-api/v1/search?q=routing&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 6,
        "limit": 20,
        "query": "routing",
        "total": 6,
        "offset": 0,
        "results": [
            {
                "name": "Inter-Domain Policy Routing Protocol",
                "number": 35,
                "keyword": "IDPR",
                "reference": "[Martha_Steenstrup]",
                "ipv6_extension_header": false
            },
            {
                "name": "Source Demand Routing Protocol",
                "number": 42,
                "keyword": "SDRP",
                "reference": "[Deborah_Estrin]",
                "ipv6_extension_header": false
            },
            {
                "name": "Routing Header for IPv6",
                "number": 43,
                "keyword": "IPv6-Route",
                "reference": "[Steve_Deering]",
                "ipv6_extension_header": true
            },
            {
                "name": "Inter-Domain Routing Protocol",
                "number": 45,
                "keyword": "IDRP",
                "reference": "[Sue_Hares]",
                "ipv6_extension_header": false
            },
            {
                "name": "Generic Routing Encapsulation",
                "number": 47,
                "keyword": "GRE",
                "reference": "[RFC2784][Tony_Li]",
                "ipv6_extension_header": false
            },
            {
                "name": "Dynamic Source Routing Protocol",
                "number": 48,
          
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals & source

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/ipprotocols-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "The 8-bit Protocol field (IPv4) / Next Header (IPv6). E.g. 6 = TCP, 17 = UDP, 1 = ICMP. Distinct from transport-layer service ports.",
        "total": 151,
        "fields": [
            "number",
            "keyword",
            "name",
            "ipv6_extension_header",
            "reference"
        ],
        "source": "IANA Assigned Internet Protocol Numbers",
        "assigned": 144
    },
    "meta": {
        "timestamp": "2026-05-31T07:00:19.712Z",
        "request_id": "a09e7f60-c2ef-40f6-9ebe-98e8c70a76da"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/ipprotocols-api
OpenAPI spec: https://www.oanor.com/api/ipprotocols-api/openapi.json
