Unit Conversion

Convert between units of measurement and discover available conversion types. Supports length, weight, volume, temperature, area, and speed conversions.

Get API Key

Overview

Use Cases

  • Scientific and engineering calculations
  • Travel and distance planning
  • Recipe scaling and cooking conversions
  • Fitness and health tracking
  • Educational tools
  • Build unit selection dropdowns in UIs

Features

Length, weight, volume, temperature, area, and speed conversions
39 supported units across 6 categories
Human-readable formula in every response
Results rounded to 6 decimal places
Fast, no-database lookups
Endpoint to discover all available units

API Endpoints

Convert Units

Convert a value from one unit to another

GET
https://requiems.xyz/v1/technology/convert

Parameters

Name Type Required Description
from string Required Source unit key (e.g. miles, kg, c)
to string Required Target unit key (e.g. km, lb, f)
value number Required Numeric value to convert

Try it out

Live Demo
Request

Source unit key (e.g. miles, kg, c)

Target unit key (e.g. km, lb, f)

Numeric value to convert

Response Fields

Field Type Description
from string Source unit key
to string Target unit key
input number The original input value
result number The converted value (rounded to 6 decimal places)
formula string Human-readable conversion formula

Code Examples

curl "https://requiems.xyz/v1/technology/convert?from=miles&to=km&value=10" \
  -H "requiems-api-key: YOUR_API_KEY"

List Available Units

Returns all available unit conversion types grouped by measurement category

GET
https://requiems.xyz/v1/technology/convert/units

Try it out

Live Demo
Request

Response Fields

Field Type Description
length array<string> Available length units: millimeter (mm), centimeter (cm), meter (m), kilometer (km), inch (in), foot (ft), yard (yd), mile (miles), nautical mile (nmi)
weight array<string> Available weight units: milligram (mg), gram (g), kilogram (kg), metric ton (t), ounce (oz), pound (lb), stone (stone)
volume array<string> Available volume units: milliliter (ml), liter (l), teaspoon (tsp), tablespoon (tbsp), fluid ounce (fl_oz), cup (cup), pint (pt), quart (qt), gallon (gal)
temperature array<string> Available temperature units: celsius (c), fahrenheit (f), kelvin (k)
area array<string> Available area units: square millimeter (mm2), square centimeter (cm2), square meter (m2), square kilometer (km2), square inch (in2), square foot (ft2), square yard (yd2), acre (acre), hectare (ha)
speed array<string> Available speed units: meters per second (m_s), kilometers per hour (km_h), miles per hour (mph), knots (knots)

Code Examples

curl https://requiems.xyz/v1/technology/convert/units \
  -H "requiems-api-key: YOUR_API_KEY"

Batch Convert Units

convert up to 50 unit conversion operations in a single request.

POST
https://requiems.xyz/v1/technology/convert/batch

Parameters

Name Type Required Description
operations array<object> Required Array of operations to convert (min: 1, max: 50).

Try it out

Live Demo
Request

Array of operations to convert (min: 1, max: 50).

Response Fields

Field Type Description
results array<object> List of unit conversion results returned in the same order as the input operations.
results[].from string Source unit used for the conversion.
results[].to string Target unit used for the conversion.
results[].success boolean Indicates whether the conversion operation was successful.
results[].error string Error message if the conversion failed. Empty when success is true.
results[].data object Conversion result details. Contains empty values when the conversion fails.
results[].data.from string Source unit.
results[].data.to string Target unit.
results[].data.input number Original numeric value provided for conversion.
results[].data.result number Converted numeric result.
results[].data.formula string Formula or conversion factor used to calculate the result.
total integer Total number of conversion results returned.

Code Examples

curl -X POST "https://requiems.xyz/v1/technology/convert/batch" \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operations": [
      {
        "from": "kg",
        "to": "lb",
        "value": 10
      },
      {
        "from": "c",
        "to": "f",
        "value": 5
      }
    ]
  }'

Error Responses

validation_failed

The operations array is missing, empty, or contains more than 50 items.

bad_request

Invalid JSON, malformed request body, or unexpected field types.

Frequently Asked Questions