UnifyUnitsDevelopers

cURL

Single conversion

bash
# GET conversion
curl "https://api.unifyunits.com/v1/convert?value=10&from=kg&to=lb" \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY"

# POST conversion
curl "https://api.unifyunits.com/v1/convert" \
  -X POST \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":"10","from":"kg","to":"lb"}'

Batch conversion

bash
curl "https://api.unifyunits.com/v1/batch" \
  -X POST \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "conversions": [
      {"value":"10","from":"kg","to":"lb"},
      {"value":"100","from":"km","to":"mi"},
      {"value":"32","from":"F","to":"C"}
    ]
  }'

Discovery

bash
curl "https://api.unifyunits.com/v1/categories"
curl "https://api.unifyunits.com/v1/units?category=mass"
curl "https://api.unifyunits.com/v1/units/kg"