
Roman Numeral Converter API
Utilities
Convert numbers to Roman numerals and back as you type, with strict checking that explains mistakes, overline numerals to 3,999,999, and a date converter.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
120 requests per minute
Endpoints
1 endpoint available
Overview
Converts numbers to Roman numerals and back, and writes dates in Roman numerals. It has two operations:
convert and date.
convert
- Send a number (
1994,12,345) to get a numeral, or a numeral (MCMXCIV) to get a number. The direction is detected from the input. - Numbers 1 to 3,999 use standard numerals. From 4,000 up to 3,999,999, the thousands are written with a combining overline (U+0305) after each letter, which means times 1,000. The
romanfield holds this text. - Numerals are checked strictly. A non-standard form such as IIII or IC returns a 400 with a plain-English reason and, where possible,
details.suggestionwith the standard form. Setlenientto true to read it anyway; the response then includesnoteandstandard. - Unicode numeral characters and overlined letters are accepted. Letters are case-insensitive.
- Parts separated by dots or dashes (
VII.IV.MMXXIV) are read one by one and returned asparts. Each part hastext,value(null when unreadable) and sometimesmessage. - Zero, negative numbers, decimals and numbers above 3,999,999 return a 400.
date
Takes a date as YYYY-MM-DD and writes the month, day and year in Roman numerals, in the order and with the separator you choose. The year must be 1 to 3,999 and the date must exist on the calendar.
Endpoints
POST
https://opentools.ca/api/v1/tools/roman-numeral-converterConvert numbers, numerals and dates
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string Enum: convert, date | Required | What to do. |
| input | string | Optional | For convert (required): a number or a Roman numeral, up to 200 characters. |
| lenient | boolean | Optional | For convert: accept non-standard numerals like IIII or IIX.Default: false |
| date | string | Optional | For date (required): a date as YYYY-MM-DD. |
| order | string Enum: MDY, DMY, YMD | Optional | For date: the order of month, day and year.Default: MDY |
| separator | string Enum: ., ·, •, -, /, | Optional | For date: the character between the parts.Default: . |
Response Example
{
"success": true,
"operation": "convert",
"direction": "numberToRoman",
"value": 1994,
"roman": "MCMXCIV",
"vinculum": false,
"steps": [
{
"value": 1000,
"roman": "M",
"over": false
},
{
"value": 900,
"roman": "CM",
"over": false
},
{
"value": 90,
"roman": "XC",
"over": false
},
{
"value": 4,
"roman": "IV",
"over": false
}
]
}Error Codes
400
Bad Request - Missing or invalid fields, a numeral that is not standard (without lenient), a number outside 1 to 3,999,999, or a date that does not exist or has a year outside 1 to 3,999. The reason is in error.401
Unauthorized - Invalid or missing API key403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
# Number to numeral
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "convert", "input": "1994"}'
# Numeral to number, accepting IIII
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "convert", "input": "IIII", "lenient": true}'
# Date to numerals: returns "VII.IV.MMXXIV"
curl -X POST https://opentools.ca/api/v1/tools/roman-numeral-converter \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation": "date", "date": "2024-07-04", "order": "MDY", "separator": "."}'Rather use it in your browser? Open the Roman Numeral Converter