/v1/parse
Requires API key
Parse a written measurement
Deterministically parses text such as `12.5 kilograms`, `100km/h`, or `5 ft 11 in` into a canonical value and unit. Optional `to` converts the parsed measurement in the same request. Ambiguous regional words return `AMBIGUOUS_UNIT` with candidates.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text
|
string | Yes | Written measurement (e.g. "5 ft 11 in" or "12.5 kg") |
to
|
string | No | Optional target unit identifier for an immediate convert |
decimals
|
integer | No | When `to` is set, round the converted result to this many fractional places (0-40, half-even). |
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
·
UNAUTHORIZED
·
INVALID_API_KEY
·
RATE_LIMIT_EXCEEDED