BloodwebMicroservices Sign in
← All microservices

Unit converter

Data

Convert between 104 units of length, mass, volume, area, temperature, speed, time, data, pressure, energy, power and angle.

What it does

  • About 110 units in 12 categories
  • Symbols or names: lb, lbs or pounds
  • One unit, or the whole category at once
  • Choose your decimal places

Good for

  • Recipe and product sites
  • Shipping weights and sizes
  • Engineering tools

Factors are the exact definitions where one exists: an inch is exactly 25.4 mm and a pound exactly 0.45359237 kg.

Example

GETPOST https://bloodweb.net/api/v1/unit-convert

curl -H "Authorization: Bearer YOUR_KEY" "https://bloodweb.net/api/v1/unit-convert?value=5&from=lb&to=kg"

Options

NameDescription
value
required
The amount to convert.
from
required
The unit it is in: a symbol (kg, mph, GiB) or a name (pounds, fahrenheit).
to The unit to convert to. Leave out for every unit in the same category.
precision Round results to this many decimal places. Left out, results keep 12 significant figures.

Returns

JSON: {"value", "from", "to", "result", "category"}, or "results" for every unit when "to" is left out.