Skip to main content

HTTP Byte Range Parser API

REAL DATA

Parse and resolve bounded RFC 9110 byte Range sets, plus validate satisfied, unknown-length and unsatisfied Content-Range field values.

Authoritative reference data or standards computation

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

GET /api/http-ranges/parse

Live requestRuns against the public API
No key required
GET/api/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234

Request parameters

RFC 9110 bytes Range value with 1–16 closed, open or suffix items.

Current representation length in bytes, bounded to JavaScript's exact safe-integer range.

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/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234"
const res = await fetch("https://randomapi.dev/api/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 2
range string required

RFC 9110 bytes Range value with 1–16 closed, open or suffix items.

allowed: 8 – 1024
example: range=bytes=0-499,-200
size int required

Current representation length in bytes, bounded to JavaScript's exact safe-integer range.

allowed: 0 – 9007199254740991
example: size=1234
Universal parameters Shared response and formatting options 4
fields list

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

example: fields=range,unit
exclude list

Return all fields except these (comma-separated).

example: exclude=unsatisfiedContentRange
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 9
range string

Canonicalized bytes Range value, preserving item order.

example: bytes=0-499,-200

unit string

Range unit; always bytes.

example: bytes

size integer

Representation length used to resolve the request.

example: 1234

requestedCount integer

Number of requested range specifications.

example: 2

satisfiableCount integer

Number of specifications satisfiable under RFC 9110.

example: 2

satisfiable boolean

True when at least one requested specification is satisfiable.

example: true

ranges object[]

Requested items with kind, satisfiability, resolved inclusive positions, length and per-part Content-Range.

example: [{"requested":"0-499","kind":"closed","satisfiable":true,"start":0,"end":499,"length":500,"contentRange":"bytes 0-499/1234"}]

contentRanges string[]

Concrete Content-Range values for resolved non-empty parts, in request order.

example: ["bytes 0-499/1234","bytes 1034-1233/1234"]

unsatisfiedContentRange string nullable

bytes */size when the entire set is unsatisfiable, otherwise null.

example: null

Documented examples

Build-generated requests and complete responses
3
Closed and suffix ranges
GET /api/http-ranges/parse?range=bytes%3D0-499%2C-200&size=1234
{
  "data": {
    "range": "bytes=0-499,-200",
    "unit": "bytes",
    "size": 1234,
    "requestedCount": 2,
    "satisfiableCount": 2,
    "satisfiable": true,
    "ranges": [
      {
        "requested": "0-499",
        "kind": "closed",
        "satisfiable": true,
        "start": 0,
        "end": 499,
        "length": 500,
        "contentRange": "bytes 0-499/1234"
      },
      {
        "requested": "-200",
        "kind": "suffix",
        "satisfiable": true,
        "start": 1034,
        "end": 1233,
        "length": 200,
        "contentRange": "bytes 1034-1233/1234"
      }
    ],
    "contentRanges": [
      "bytes 0-499/1234",
      "bytes 1034-1233/1234"
    ],
    "unsatisfiedContentRange": null
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/parse",
    "params": {
      "range": "bytes=0-499,-200",
      "size": 1234
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Open range truncated at the representation end
GET /api/http-ranges/parse?range=bytes%3D500-&size=800
{
  "data": {
    "range": "bytes=500-",
    "unit": "bytes",
    "size": 800,
    "requestedCount": 1,
    "satisfiableCount": 1,
    "satisfiable": true,
    "ranges": [
      {
        "requested": "500-",
        "kind": "open",
        "satisfiable": true,
        "start": 500,
        "end": 799,
        "length": 300,
        "contentRange": "bytes 500-799/800"
      }
    ],
    "contentRanges": [
      "bytes 500-799/800"
    ],
    "unsatisfiedContentRange": null
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/parse",
    "params": {
      "range": "bytes=500-",
      "size": 800
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
An unsatisfiable range for an empty representation
GET /api/http-ranges/parse?range=bytes%3D0-&size=0
{
  "data": {
    "range": "bytes=0-",
    "unit": "bytes",
    "size": 0,
    "requestedCount": 1,
    "satisfiableCount": 0,
    "satisfiable": false,
    "ranges": [
      {
        "requested": "0-",
        "kind": "open",
        "satisfiable": false,
        "start": null,
        "end": null,
        "length": 0,
        "contentRange": null
      }
    ],
    "contentRanges": [],
    "unsatisfiedContentRange": "bytes */0"
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/parse",
    "params": {
      "range": "bytes=0-",
      "size": 0
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

GET /api/http-ranges/content-range

Live requestRuns against the public API
No key required
GET/api/http-ranges/content-range?value=bytes+0-499%2F1234

Request parameters

RFC 9110 bytes Content-Range value: inclusive range/size, range/* or */size.

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/http-ranges/content-range?value=bytes%200-499%2F1234"
const res = await fetch("https://randomapi.dev/api/http-ranges/content-range?value=bytes%200-499%2F1234");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/http-ranges/content-range?value=bytes%200-499%2F1234").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/http-ranges/content-range?value=bytes%200-499%2F1234"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 1
value string required

RFC 9110 bytes Content-Range value: inclusive range/size, range/* or */size.

allowed: 9 – 512
example: value=bytes 0-499/1234
Universal parameters Shared response and formatting options 4
fields list

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

example: fields=value,unit
exclude list

Return all fields except these (comma-separated).

example: exclude=completeLengthKnown
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 8
value string

Validated canonical Content-Range field value.

example: bytes 0-499/1234

unit string

Range unit; this endpoint supports bytes only.

example: bytes

satisfied boolean

True for an inclusive range response; false for the */size form used with 416.

example: true

start integer nullable

Inclusive first byte, or null for an unsatisfied range.

example: 0

end integer nullable

Inclusive last byte, or null for an unsatisfied range.

example: 499

length integer nullable

Number of bytes in a satisfied inclusive range, or null.

example: 500

size integer nullable

Complete representation length, or null when represented by *.

example: 1234

completeLengthKnown boolean

Whether Content-Range carries a numeric complete length.

example: true

Documented examples

Build-generated requests and complete responses
3
Known complete length
GET /api/http-ranges/content-range?value=bytes%200-499%2F1234
{
  "data": {
    "value": "bytes 0-499/1234",
    "unit": "bytes",
    "satisfied": true,
    "start": 0,
    "end": 499,
    "length": 500,
    "size": 1234,
    "completeLengthKnown": true
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/content-range",
    "params": {
      "value": "bytes 0-499/1234"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Unknown complete length
GET /api/http-ranges/content-range?value=bytes%2042-1233%2F*
{
  "data": {
    "value": "bytes 42-1233/*",
    "unit": "bytes",
    "satisfied": true,
    "start": 42,
    "end": 1233,
    "length": 1192,
    "size": null,
    "completeLengthKnown": false
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/content-range",
    "params": {
      "value": "bytes 42-1233/*"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Unsatisfied zero-length representation
GET /api/http-ranges/content-range?value=bytes%20*%2F0
{
  "data": {
    "value": "bytes */0",
    "unit": "bytes",
    "satisfied": false,
    "start": null,
    "end": null,
    "length": null,
    "size": 0,
    "completeLengthKnown": true
  },
  "meta": {
    "endpoint": "http-ranges",
    "route": "/content-range",
    "params": {
      "value": "bytes */0"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Strict, bounded tools for RFC 9110 byte range requests. /parse accepts closed ranges (0-499), open ranges (500-), suffix ranges (-500) and multi-range sets, then resolves every item against a supplied representation size. Byte positions are inclusive, values above JavaScript's exact safe-integer limit are rejected, and no more than 16 ranges are accepted.

An invalid range set returns 400. A syntactically valid but unsatisfiable set returns a normal result with satisfiable=false and the 416 response value bytes */size; a mixed set remains satisfiable when at least one item can be served. RFC 9110 specifically defines a non-zero suffix range as satisfiable for a zero-length representation, although it resolves to zero bytes and has no concrete Content-Range positions—the response reports that edge case explicitly rather than inventing 0--1.

/content-range validates the three byte forms used by RFC 9110: a known complete length, an unknown complete length (*), or the unsatisfied */size form. It rejects reversed ranges and known complete lengths that are not greater than the last byte. This API parses header values; it does not fetch content or build multipart bodies.

Use it for

  • Resolve download resume requests against a known file size
  • Validate Content-Range values before recombining cached partial responses
  • Test suffix, open-ended, multi-range and 416 edge cases without network I/O

Frequently asked questions

Does the parser support suffix and open-ended ranges?

Yes. bytes=-500 selects up to the final 500 bytes and bytes=500- selects from byte 500 through the representation's end.

What happens when only some requested ranges are satisfiable?

Every item is reported separately, and the complete set is satisfiable when at least one item is satisfiable. The endpoint preserves request order and does not merge overlaps.

How are unsatisfied ranges represented?

When no requested item is satisfiable, unsatisfiedContentRange contains the RFC 9110 value bytes */size, suitable for a 416 response.

Does it accept arbitrarily large range integers?

No. RFC 9110 requires overflow-safe parsing; this API deliberately caps every byte integer at JavaScript's exact limit (9007199254740991) and returns 400 above it.

Standards & references