Unit Conversion

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

Get API Key

Vue d'ensemble

Cas d'utilisation

  • 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

Fonctionnalités

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

Points de terminaison de l'API

Convert Units

Convert a value from one unit to another

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

Paramètres

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

Essayez-le

Démo en direct
Requête

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

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

Numeric value to convert

Champs de réponse

Champ 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

Exemples de code

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

Essayez-le

Démo en direct
Requête

Champs de réponse

Champ 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)

Exemples de code

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

Paramètres

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

Essayez-le

Démo en direct
Requête

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

Champs de réponse

Champ 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.

Exemples de code

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
      }
    ]
  }'

Réponses d'erreur

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.

Foire aux questions