Unitly API & Embed Widget

A free, key-less unit conversion API and an embeddable widget. No sign-up, CORS-enabled, 27 categories and 130+ units.

REST API

Base URL: https://www.unitly.fyi. All responses are JSON with Access-Control-Allow-Origin: *, so you can call them from the browser or a server.

GET /api/convert

Convert a value between two units. Parameters: from and to (unit ids, required), value (number, default 1), category (optional — inferred when both units are unambiguous).

/api/convert?category=length&from=meter&to=foot&value=10

{
  "ok": true,
  "category": "length",
  "value": 10,
  "from": { "id": "meter", "name": "Meter", "symbol": "m" },
  "to":   { "id": "foot",  "name": "Foot",  "symbol": "ft" },
  "result": 32.80839895013123,
  "formatted": "32.808399",
  "formula": "1 Meter = 3.28084 ft"
}

GET /api/units

Lists every category and its units, so you can discover valid ids (response truncated below).

{
  "ok": true,
  "count": 15,
  "categories": [
    {
      "id": "length",
      "name": "Length",
      "baseUnit": "meter",
      "units": [
        { "id": "meter", "name": "Meter", "symbol": "m" },
        { "id": "foot",  "name": "Foot",  "symbol": "ft" }
      ]
    }
  ]
}

Errors return { "ok": false, "error": "…" } with a 4xx status. Responses are cached; please cache on your side too and keep usage reasonable.

Embed widget

Drop a live converter onto any page with one line. Set category, from, and to in the URL.

<iframe
  src="https://www.unitly.fyi/embed?category=length&from=meter&to=foot"
  width="100%" height="230" loading="lazy"
  style="border:0;max-width:440px"
  title="Unit converter by Unitly.fyi"></iframe>

Live preview

Free to use

The API and widget are free for personal and commercial use. There is no API key and no hard rate limit today — please cache responses and don't hammer the endpoints. A link back to Unitly.fyi is appreciated (the embed widget includes one automatically).