← Roman · Numerals

· Developer · Documentation ·

API

Version · I · JSON · CORS

· Overview ·

A read-only API for roman numerals. All endpoints return JSON and allow CORS from any origin. Static responses (everything except /today) are CDN-cached for a week; /today is cached until the next midnight in Europe/Stockholm. Browsers always revalidate (max-age=0).

The valid range is 13999, which is what classical roman numerals can express.

Endpoints
Response

/to/{n} and /from/{roman} return a pair:

{
  "arabic": 2026,
  "roman": "MMXXVI"
}

/convert/{value} additionally includes a kind field that shows which direction it converted:

{
  "kind": "roman",
  "input": "MMXXVI",
  "roman": "MMXXVI",
  "arabic": 2026
}
Errors

Errors are returned as JSON. Status codes:

{
  "error": {
    "status": 422,
    "message": "Invalid number \"5000\". Must be between 1 and 3999."
  }
}
Source

This API is built on the @tammergard/roman package on npm.

Back