apyhub
Back

Unit and Number Conversion API

What it does

Unit Conversion API converts values across common measurement systems. Send a numeric value plus from and to units, and get back a converted result as an object.

Use it for weight conversion between kg, g, mg, lb, and oz; temperature conversion between C, F, and K; file size conversion between B, KB, MB, GB, TB, and PB; and length conversion between m, cm, mm, km, in, ft, yd, and mi. It also converts Roman numerals in both directions: set direction to toRoman or fromRoman and pass a value as a number or string as required.

This is useful when you normalize user-entered measurements, convert product dimensions, format storage values, or support locale-aware inputs in calculators and internal tools. The request shape is consistent across the conversion endpoints, which makes it easy to wire into forms, workflows, or backend validation logic.

If you need a small utility endpoint for turning one unit or numeral system into another, Unit Conversion API keeps the contract simple and focused.

▣ ENDPOINT 01 / 05
POST
Convert a weight between kilograms, grams, pounds and ounces
https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/weight

QUICKSTART

GUIDE

Quickstart

Convert a weight by sending the value and units to the endpoint.

curl -X POST "https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/weight" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value": 10, "from": "kg", "to": "lb"}'

What you'll get back

Returns a JSON object. The output schema does not declare any top-level fields, so the response shape is not specified here.

{
  "result": 22.046226218487757
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a weight value from one unit to another and returns the conversion result. The request body must include the source unit, target unit, and numeric value to convert.

Request Body

ParameterTypeMandatoryDescription
valueNumberYesNumeric weight value to convert.
fromENUMYesSource unit. Allowed values: kg, g, mg, lb, oz.
toENUMYesTarget unit. Allowed values: kg, g, mg, lb, oz.

Response

ParameterTypeDescription
resultnumberCalculated result returned by the API.
▣ ENDPOINT 02 / 05
POST
Convert a temperature between Celsius, Fahrenheit and Kelvin
https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/temperature

QUICKSTART

GUIDE

Quickstart

Convert a temperature value from one unit to another by sending the source unit, target unit, and numeric value.

curl -X POST "https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/temperature" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":25,"from":"C","to":"F"}'

What you'll get back

Returns a JSON object. The output schema does not declare any top-level fields, so the response shape is not specified here.

{
  "result": 77
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a temperature from one unit to another among Celsius, Fahrenheit, and Kelvin. The request body provides the numeric value plus the source and target unit; the response schema is not yet defined.

Request Body

ParameterTypeMandatoryDescription
valueNumberYesTemperature value to convert.
fromENUMYesSource unit. Allowed values: C, F, K.
toENUMYesTarget unit. Allowed values: C, F, K.

Response

ParameterTypeDescription
resultnumberCalculated result returned by the API.
▣ ENDPOINT 03 / 05
POST
Convert a file size between bytes, KB, MB, GB, TB and PB
https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/file-size

QUICKSTART

GUIDE

Quickstart

Convert a file size from one unit to another with a single JSON request.

curl -X POST "https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/file-size" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":1024,"from":"B","to":"KB"}'

What you'll get back

Returns a JSON object. The schema does not declare any top-level fields, so the exact response shape is not specified here.

{
  "result": {
    "bytes": 1024,
    "converted": 1,
    "from": "B",
    "to": "KB",
    "formatted": "1 KB"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a numeric file size from one unit to another for the /file-size endpoint. You send the value to convert plus the source and target units, and the endpoint returns a success response whose detailed JSON shape is not yet captured in the schema.

Request Body

ParameterTypeMandatoryDescription
valueNumberYesFile size value to convert.
fromENUMYesSource unit. Allowed values: B, KB, MB, GB, TB, PB.
toENUMYesTarget unit. Allowed values: B, KB, MB, GB, TB, PB.

Response

ParameterTypeDescription
resultobjectContains the file size conversion result.
result.bytesnumberOriginal file size in bytes.
result.convertednumberConverted file size in the target unit.
result.fromstringSource unit of measurement.
result.tostringTarget unit of measurement.
result.formattedstringHuman-readable representation of the converted file size.
▣ ENDPOINT 04 / 05
POST
Convert a length between metres, kilometres, inches, feet, yards and miles
https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/length

QUICKSTART

GUIDE

Quickstart

Convert a length by sending the value and source/target units in a JSON body.

curl -X POST "https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/length" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":100,"from":"cm","to":"m"}'

What you'll get back

Returns a JSON object. The response schema does not declare any fields, so no response shape is guaranteed here.

{
  "result": 1
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts a numeric length value from one supported unit to another. Submit the source unit, target unit, and value in the request body; the endpoint returns a JSON object, but the response schema does not define its fields.

Request Body

ParameterTypeMandatoryDescription
valueNumberYesThe length value to convert.
fromENUMYesSource unit. Allowed values: m, cm, mm, km, in, ft, yd, mi.
toENUMYesTarget unit. Allowed values: m, cm, mm, km, in, ft, yd, mi.

Response

ParameterTypeDescription
resultnumberConverted or calculated result returned by the API.
▣ ENDPOINT 05 / 05
POST
Convert numbers to Roman numerals and back
https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/roman

QUICKSTART

GUIDE

Quickstart

Convert a value to or from Roman numerals by sending the required direction and value fields.

curl -X POST "https://api.eu.apyhub.com/freedailypro/unit-and-number-conversion/roman" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"direction":"toRoman","value":1984}'

What you'll get back

Returns a JSON object. The output schema does not declare any top-level fields, so the exact response shape is not specified here.

{
  "result": "MCMLXXXIV",
  "vinculum": false,
  "breakdown": "M + CM + LXXX + IV",
  "steps": [
    {
      "label": "thousands: 1,000",
      "formula": "1,000 is written M",
      "inputs": {
        "value": "1,000"
      },
      "result": "M"
    },
    {
      "label": "hundreds: 900",
      "formula": "900 is written CM",
      "inputs": {
        "value": "900"
      },
      "result": "CM"
    },
    {
      "label": "tens: 80",
      "formula": "80 is written LXXX",
      "inputs": {
        "value": "80"
      },
      "result": "LXXX"
    },
    {
      "label": "ones: 4",
      "formula": "4 is written IV",
      "inputs": {
        "value": "4"
      },
      "result": "IV"
    },
    {
      "label": "Join the pieces",
      "formula": "Write the pieces from the largest place to the smallest",
      "inputs": {
        "pieces": "M + CM + LXXX + IV"
      },
      "result": "MCMLXXXIV"
    }
  ]
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
toRoman: a whole number from 1 to 3,999,999 (above 3,999 the thousands get a bar over every letter, written with the Unicode combining overline U+0305). fromRoman: a numeral; barred letters may be typed with U+0305 or as a bracketed group such as (V) for 5,000.

About this endpoint

What it does

Converts a value between Arabic numbers and Roman numerals. Send a request body with direction and value; the endpoint interprets the value according to the chosen direction and returns a response, but the response schema is not yet defined.

Request Body

ParameterTypeMandatoryDescription
directionENUMYesConversion direction. Allowed values: toRoman, fromRoman.
valueNumber / StringYesThe input to convert. For toRoman, provide a whole number from 1 to 3,999,999; values above 3,999 may use a Unicode combining overline (U+0305) for the thousands. For fromRoman, provide a Roman numeral; barred letters may be typed with U+0305 or as a bracketed group such as (V) for 5,000.

Response

ParameterTypeDescription
resultstringConverted number represented in Roman numerals.
vinculumbooleanIndicates whether vinculum notation is used.
breakdownstringBreakdown of the Roman numeral into its individual components.
stepsarrayContains the step-by-step conversion details.
steps[].labelstringName or description of the conversion step.
steps[].formulastringRule or explanation used in the conversion step.
steps[].inputsobjectInput values used in the conversion step.
steps[].resultstringResult produced at that conversion step.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.