{
  "x402Version": 2,
  "id": 72476,
  "slug": "saylorinnovations-api-net-range-to-cidr",
  "resource": "https://saylorinnovations.com/api/net/range-to-cidr",
  "description": "Convert an IPv4 start and end address into the minimal list of CIDR blocks, with the first and last address and size of each block",
  "type": "http",
  "serviceName": "Saylor Innovations Data Desk",
  "mimeType": "application/json",
  "resourceType": "API",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:137",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "eip155:42161",
      "payTo": "0xA2A8dF0f7CaaBEa4e120a2568118f141569fc8aa",
      "asset": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
      "amount": "10000",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    },
    {
      "scheme": "exact",
      "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "payTo": "7LSjfrJf8fNsB8VA9u7N3WEn25smQLpob3SvyUvXacy7",
      "asset": "So11111111111111111111111111111111111111112",
      "amount": "95830",
      "amountUsd": 0.01,
      "maxTimeoutSeconds": 120
    }
  ],
  "outputSchema": {
    "type": "object",
    "properties": {
      "start": {
        "type": "string",
        "description": "First address of the range"
      },
      "end": {
        "type": "string",
        "description": "Last address of the range"
      },
      "addresses": {
        "type": "number",
        "description": "Addresses in the range"
      },
      "cidr_blocks": {
        "type": "number",
        "description": "Cidr blocks"
      },
      "cidrs": {
        "type": "array",
        "description": "Minimal CIDR list covering the range"
      },
      "blocks": {
        "type": "array",
        "description": "Each block with first, last and size",
        "items": {
          "type": "object",
          "properties": {
            "first": {
              "description": "First address of the block",
              "type": [
                "string",
                "null"
              ]
            },
            "last": {
              "description": "Last address of the block",
              "type": [
                "string",
                "null"
              ]
            },
            "addresses": {
              "description": "Addresses in the block",
              "type": [
                "number",
                "null"
              ]
            },
            "cidr": {
              "description": "CIDR block"
            }
          }
        }
      },
      "is_single_cidr": {
        "type": "boolean",
        "description": "True when this is single cidr"
      },
      "source": {
        "type": "string",
        "description": "Data source the values come from"
      }
    },
    "required": [
      "cidrs",
      "addresses"
    ]
  },
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "type": "http",
          "method": "GET",
          "queryParams": {
            "end": "10.0.1.200",
            "start": "10.0.0.5"
          }
        },
        "output": {
          "type": "json",
          "example": {
            "start": "10.0.0.5",
            "end": "10.0.1.200",
            "addresses": 452,
            "cidr_blocks": 11,
            "cidrs": [
              "10.0.0.5/32",
              "10.0.0.6/31",
              "10.0.0.8/29",
              "10.0.0.16/28",
              "10.0.0.32/27",
              "10.0.0.64/26",
              "10.0.0.128/25",
              "10.0.1.0/25",
              "10.0.1.128/26",
              "10.0.1.192/29",
              "10.0.1.200/32"
            ],
            "blocks": [
              {
                "cidr": "10.0.0.5/32",
                "first": "10.0.0.5",
                "last": "10.0.0.5",
                "addresses": 1
              },
              {
                "cidr": "10.0.0.6/31",
                "first": "10.0.0.6",
                "last": "10.0.0.7",
                "addresses": 2
              },
              {
                "cidr": "10.0.0.8/29",
                "first": "10.0.0.8",
                "last": "10.0.0.15",
                "addresses": 8
              },
              {
                "cidr": "10.0.0.16/28",
                "first": "10.0.0.16",
                "last": "10.0.0.31",
                "addresses": 16
              },
              {
                "cidr": "10.0.0.32/27",
                "first": "10.0.0.32",
                "last": "10.0.0.63",
                "addresses": 32
              },
              {
                "cidr": "10.0.0.64/26",
                "first": "10.0.0.64",
                "last": "10.0.0.127",
                "addresses": 64
              },
              {
                "cidr": "10.0.0.128/25",
                "first": "10.0.0.128",
                "last": "10.0.0.255",
                "addresses": 128
              },
              {
                "cidr": "10.0.1.0/25",
                "first": "10.0.1.0",
                "last": "10.0.1.127",
                "addresses": 128
              },
              {
                "cidr": "10.0.1.128/26",
                "first": "10.0.1.128",
                "last": "10.0.1.191",
                "addresses": 64
              },
              {
                "cidr": "10.0.1.192/29",
                "first": "10.0.1.192",
                "last": "10.0.1.199",
                "addresses": 8
              },
              {
                "cidr": "10.0.1.200/32",
                "first": "10.0.1.200",
                "last": "10.0.1.200",
                "addresses": 1
              }
            ],
            "is_single_cidr": false,
            "source": "Minimal CIDR cover of an IPv4 range (RFC 4632)"
          }
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "input": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "http"
              },
              "method": {
                "type": "string",
                "enum": [
                  "GET"
                ]
              },
              "queryParams": {
                "type": "object",
                "properties": {
                  "end": {
                    "type": "string",
                    "description": "Last IPv4 address"
                  },
                  "start": {
                    "type": "string",
                    "description": "First IPv4 address"
                  }
                },
                "required": [
                  "end",
                  "start"
                ]
              }
            },
            "required": [
              "type",
              "method"
            ],
            "additionalProperties": false
          },
          "output": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "json"
              },
              "example": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string",
                    "description": "First address of the range"
                  },
                  "end": {
                    "type": "string",
                    "description": "Last address of the range"
                  },
                  "addresses": {
                    "type": "number",
                    "description": "Addresses in the range"
                  },
                  "cidr_blocks": {
                    "type": "number",
                    "description": "Cidr blocks"
                  },
                  "cidrs": {
                    "type": "array",
                    "description": "Minimal CIDR list covering the range"
                  },
                  "blocks": {
                    "type": "array",
                    "description": "Each block with first, last and size",
                    "items": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "description": "First address of the block",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "last": {
                          "description": "Last address of the block",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "addresses": {
                          "description": "Addresses in the block",
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "cidr": {
                          "description": "CIDR block"
                        }
                      }
                    }
                  },
                  "is_single_cidr": {
                    "type": "boolean",
                    "description": "True when this is single cidr"
                  },
                  "source": {
                    "type": "string",
                    "description": "Data source the values come from"
                  }
                },
                "required": [
                  "cidrs",
                  "addresses"
                ]
              }
            },
            "required": [
              "type"
            ]
          }
        },
        "required": [
          "input"
        ]
      }
    }
  },
  "tags": [
    "convert an ip range to cidr",
    "minimal cidr list for a start",
    "firewall rule from an address",
    "how many cidr blocks cover",
    "ip range to subnet notation"
  ],
  "sourceHost": "saylorinnovations.com",
  "lastUpdated": "2026-10-26T22:14:01.951Z",
  "quality": {},
  "metadata": {
    "serviceName": "Saylor Innovations Data Desk",
    "method": "GET",
    "mimeType": "application/json",
    "inputSchema": {
      "type": "object",
      "properties": {
        "end": {
          "type": "string",
          "description": "Last IPv4 address"
        },
        "start": {
          "type": "string",
          "description": "First IPv4 address"
        }
      },
      "required": [
        "end",
        "start"
      ]
    },
    "exampleResponse": {
      "start": "10.0.0.5",
      "end": "10.0.1.200",
      "addresses": 452,
      "cidr_blocks": 11,
      "cidrs": [
        "10.0.0.5/32",
        "10.0.0.6/31",
        "10.0.0.8/29",
        "10.0.0.16/28",
        "10.0.0.32/27",
        "10.0.0.64/26",
        "10.0.0.128/25",
        "10.0.1.0/25",
        "10.0.1.128/26",
        "10.0.1.192/29",
        "10.0.1.200/32"
      ],
      "blocks": [
        {
          "cidr": "10.0.0.5/32",
          "first": "10.0.0.5",
          "last": "10.0.0.5",
          "addresses": 1
        },
        {
          "cidr": "10.0.0.6/31",
          "first": "10.0.0.6",
          "last": "10.0.0.7",
          "addresses": 2
        },
        {
          "cidr": "10.0.0.8/29",
          "first": "10.0.0.8",
          "last": "10.0.0.15",
          "addresses": 8
        },
        {
          "cidr": "10.0.0.16/28",
          "first": "10.0.0.16",
          "last": "10.0.0.31",
          "addresses": 16
        },
        {
          "cidr": "10.0.0.32/27",
          "first": "10.0.0.32",
          "last": "10.0.0.63",
          "addresses": 32
        },
        {
          "cidr": "10.0.0.64/26",
          "first": "10.0.0.64",
          "last": "10.0.0.127",
          "addresses": 64
        },
        {
          "cidr": "10.0.0.128/25",
          "first": "10.0.0.128",
          "last": "10.0.0.255",
          "addresses": 128
        },
        {
          "cidr": "10.0.1.0/25",
          "first": "10.0.1.0",
          "last": "10.0.1.127",
          "addresses": 128
        },
        {
          "cidr": "10.0.1.128/26",
          "first": "10.0.1.128",
          "last": "10.0.1.191",
          "addresses": 64
        },
        {
          "cidr": "10.0.1.192/29",
          "first": "10.0.1.192",
          "last": "10.0.1.199",
          "addresses": 8
        },
        {
          "cidr": "10.0.1.200/32",
          "first": "10.0.1.200",
          "last": "10.0.1.200",
          "addresses": 1
        }
      ],
      "is_single_cidr": false,
      "source": "Minimal CIDR cover of an IPv4 range (RFC 4632)"
    },
    "parameterLocation": "query",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "type": "http",
            "method": "GET",
            "queryParams": {
              "end": "10.0.1.200",
              "start": "10.0.0.5"
            }
          },
          "output": {
            "type": "json",
            "example": {
              "start": "10.0.0.5",
              "end": "10.0.1.200",
              "addresses": 452,
              "cidr_blocks": 11,
              "cidrs": [
                "10.0.0.5/32",
                "10.0.0.6/31",
                "10.0.0.8/29",
                "10.0.0.16/28",
                "10.0.0.32/27",
                "10.0.0.64/26",
                "10.0.0.128/25",
                "10.0.1.0/25",
                "10.0.1.128/26",
                "10.0.1.192/29",
                "10.0.1.200/32"
              ],
              "blocks": [
                {
                  "cidr": "10.0.0.5/32",
                  "first": "10.0.0.5",
                  "last": "10.0.0.5",
                  "addresses": 1
                },
                {
                  "cidr": "10.0.0.6/31",
                  "first": "10.0.0.6",
                  "last": "10.0.0.7",
                  "addresses": 2
                },
                {
                  "cidr": "10.0.0.8/29",
                  "first": "10.0.0.8",
                  "last": "10.0.0.15",
                  "addresses": 8
                },
                {
                  "cidr": "10.0.0.16/28",
                  "first": "10.0.0.16",
                  "last": "10.0.0.31",
                  "addresses": 16
                },
                {
                  "cidr": "10.0.0.32/27",
                  "first": "10.0.0.32",
                  "last": "10.0.0.63",
                  "addresses": 32
                },
                {
                  "cidr": "10.0.0.64/26",
                  "first": "10.0.0.64",
                  "last": "10.0.0.127",
                  "addresses": 64
                },
                {
                  "cidr": "10.0.0.128/25",
                  "first": "10.0.0.128",
                  "last": "10.0.0.255",
                  "addresses": 128
                },
                {
                  "cidr": "10.0.1.0/25",
                  "first": "10.0.1.0",
                  "last": "10.0.1.127",
                  "addresses": 128
                },
                {
                  "cidr": "10.0.1.128/26",
                  "first": "10.0.1.128",
                  "last": "10.0.1.191",
                  "addresses": 64
                },
                {
                  "cidr": "10.0.1.192/29",
                  "first": "10.0.1.192",
                  "last": "10.0.1.199",
                  "addresses": 8
                },
                {
                  "cidr": "10.0.1.200/32",
                  "first": "10.0.1.200",
                  "last": "10.0.1.200",
                  "addresses": 1
                }
              ],
              "is_single_cidr": false,
              "source": "Minimal CIDR cover of an IPv4 range (RFC 4632)"
            }
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "type": "object",
          "properties": {
            "input": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "http"
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "GET"
                  ]
                },
                "queryParams": {
                  "type": "object",
                  "properties": {
                    "end": {
                      "type": "string",
                      "description": "Last IPv4 address"
                    },
                    "start": {
                      "type": "string",
                      "description": "First IPv4 address"
                    }
                  },
                  "required": [
                    "end",
                    "start"
                  ]
                }
              },
              "required": [
                "type",
                "method"
              ],
              "additionalProperties": false
            },
            "output": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json"
                },
                "example": {
                  "type": "object",
                  "properties": {
                    "start": {
                      "type": "string",
                      "description": "First address of the range"
                    },
                    "end": {
                      "type": "string",
                      "description": "Last address of the range"
                    },
                    "addresses": {
                      "type": "number",
                      "description": "Addresses in the range"
                    },
                    "cidr_blocks": {
                      "type": "number",
                      "description": "Cidr blocks"
                    },
                    "cidrs": {
                      "type": "array",
                      "description": "Minimal CIDR list covering the range"
                    },
                    "blocks": {
                      "type": "array",
                      "description": "Each block with first, last and size",
                      "items": {
                        "type": "object",
                        "properties": {
                          "first": {
                            "description": "First address of the block",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "last": {
                            "description": "Last address of the block",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "addresses": {
                            "description": "Addresses in the block",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "cidr": {
                            "description": "CIDR block"
                          }
                        }
                      }
                    },
                    "is_single_cidr": {
                      "type": "boolean",
                      "description": "True when this is single cidr"
                    },
                    "source": {
                      "type": "string",
                      "description": "Data source the values come from"
                    }
                  },
                  "required": [
                    "cidrs",
                    "addresses"
                  ]
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "required": [
            "input"
          ]
        }
      }
    },
    "examples": [
      {
        "label": "Unpaid discovery call",
        "method": "GET",
        "url": "https://saylorinnovations.com/api/net/range-to-cidr?start=10.0.0.5&end=10.0.1.200",
        "expectedStatus": 402
      }
    ],
    "cacheTtlSeconds": 0,
    "capabilities": [],
    "noAccountRequired": true,
    "noApiKeyRequired": true,
    "sideEffects": "Paid calls settle the advertised payment; see the provider contract for execution behavior.",
    "payment": {
      "protocol": "x402",
      "settlement": "direct-to-provider"
    },
    "provider": {
      "name": "Saylor Innovations",
      "host": "saylorinnovations.com",
      "manifestUrl": "https://saylorinnovations.com/.well-known/x402.json"
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": true,
  "featured": false,
  "provider": {
    "host": "saylorinnovations.com",
    "manifest_name": "Saylor Innovations Knowledge Base",
    "source": "submitted",
    "source_manifest_url": "https://saylorinnovations.com/.well-known/x402.json",
    "submitted_at": "2026-10-26T05:52:02.113Z"
  },
  "exampleResponse": {
    "start": "string",
    "end": "string",
    "addresses": 0,
    "cidr_blocks": 0,
    "cidrs": [
      "value"
    ],
    "blocks": [
      {
        "first": "string",
        "last": "string",
        "addresses": 0,
        "cidr": null
      }
    ],
    "is_single_cidr": true,
    "source": "string"
  }
}