UnifyUnits Developers
GET /v1/convert Requires API key

Single conversion via query parameters

Converts one measurement value from a source unit to a target unit. `value`, `from`, and `to` are required. Optional `decimals` rounds the result.

Prefer a language client when available: JavaScript / TypeScript, Python, or PHP (Laravel). Samples on this page stay raw HTTP so they match the OpenAPI contract.

Parameters

Name Type Required Description
value string Yes Measurement value as a decimal string (e.g. "10.5")
from string Yes Source unit identifier (e.g. "kg")
to string Yes Target unit identifier (e.g. "lb")
decimals integer No Round the result to this many fractional decimal places (0-40, half-even). Omit for the full engine precision string.
format_locale string No Language tag such as de-DE. Adds a formatted display string (for example 1,5 km) to the result next to the exact value. Requires the Developer plan or higher.

Possible errors

PLAN_REQUIRED · INVALID_VALUE · UNKNOWN_UNIT · AMBIGUOUS_UNIT · INCOMPATIBLE_UNITS · OUT_OF_RANGE · INVALID_REQUEST · UNAUTHORIZED · INVALID_API_KEY · RATE_LIMIT_EXCEEDED · QUOTA_EXCEEDED · SERVICE_UNAVAILABLE

All endpoints · Error reference

cURL
curl "https://api.unifyunits.com/v1/convert?value=10&from=kg&to=lb&decimals=2" \
  -H "Authorization: Bearer $UNIFYUNITS_API_KEY"

Response 200

json
{
  "data": {
    "input": { "value": "10", "unit": "kg" },
    "result": {
      "value": "22.04622621848775807229738013450270338542",
      "unit": "lb"
    },
    "category": "mass"
  }
}