Single conversion
Use GET /v1/convert with query parameters or POST /v1/convert with a JSON body. Both share the same conversion engine.
Rules
- Send
valueas a decimal string - Prefer canonical unit IDs from GET /v1/units
- Source and target must be in the same category
-
Optional
decimals(0-40) roundsresult.value; see precision - Authentication is required
Example
bash
curl "https://api.unifyunits.com/v1/convert?value=10&from=kg&to=lb&decimals=2" \
-H "Authorization: Bearer $UNIFYUNITS_API_KEY"
See also precision and batch conversion.