Unit Conversion

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

Get API Key

Descripción general

Casos de uso

  • 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

Funcionalidades

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

Puntos finales de la API

Convert Units

Convert a value from one unit to another

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

Parámetros

Nombre Tipo Obligatorio Descripción
from string Obligatorio Source unit key (e.g. miles, kg, c)
to string Obligatorio Target unit key (e.g. km, lb, f)
value number Obligatorio Numeric value to convert

Pruébalo

Demostración en vivo
Solicitud

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

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

Numeric value to convert

Campos de respuesta

Campo Tipo Descripción
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

Ejemplos de código

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

Pruébalo

Demostración en vivo
Solicitud

Campos de respuesta

Campo Tipo Descripción
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)

Ejemplos de código

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

Parámetros

Nombre Tipo Obligatorio Descripción
operations array<object> Obligatorio Array of operations to convert (min: 1, max: 50).

Pruébalo

Demostración en vivo
Solicitud

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

Campos de respuesta

Campo Tipo Descripción
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.

Ejemplos de código

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

Respuestas de error

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.

Preguntas frecuentes