UnifyUnitsDevelopers
POST/v1/convertRequires API key

Single conversion via JSON body

Identical conversion behaviour to GET /v1/convert, using a JSON request body instead of query parameters. Both methods share the same conversion engine.

Parameters

NameTypeRequiredDescription
valuestringYesMeasurement value as a decimal string
fromstringYesSource unit identifier
tostringYesTarget unit identifier

Possible errors

INVALID_VALUE · UNKNOWN_UNIT · AMBIGUOUS_UNIT · INCOMPATIBLE_UNITS · OUT_OF_RANGE · INVALID_REQUEST · UNAUTHORIZED · INVALID_API_KEY · RATE_LIMIT_EXCEEDED

All endpoints · Error reference

cURL
curl "https://api.unifyunits.com/v1/convert" \
  -X POST \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "1",
    "from": "ft",
    "to": "m"
  }'

Response 200

json
{
  "data": {
    "input": { "value": "1", "unit": "ft" },
    "result": { "value": "0.3048", "unit": "m" },
    "category": "length"
  }
}