Developers
A free JSON conversion API and a copy-paste converter widget, both built on the same exact factors as the rest of UnitGlide. No key, no sign-up.
JSON API
Send a GET request with a from unit id, a to unit id and an optional value (default 1). Responses are CORS-open, so you can call it straight from the browser.
Request
https://unitglide.net/api/v1/convert?from=kg&to=lb&value=5Response
{
"ok": true,
"category": "mass",
"value": 5,
"from": { "id": "kg", "name": "Kilogram", "symbol": "kg" },
"to": { "id": "lb", "name": "Pound", "symbol": "lb" },
"result": 11.023113109243878,
"formatted": "11.0231",
"source": "https://unitglide.net/convert/kg-to-lb",
"license": "https://creativecommons.org/licenses/by/4.0/",
"attribution": "UnitGlide, https://unitglide.net"
}result is the full-precision number; formatted is the trimmed display value. Unit ids are the short slugs used across the site (kg, lb, cm, c, f…). Both units must be in the same category, or the API returns a 400 with an explanation.
The full catalogue of categories and unit ids is available at /api/v1/units, and every conversion factor with its source and an exactness flag at /api/v1/factors, the machine-readable version of the methodology page.
The unversioned /api/convert and /api/units still work and their responses are unchanged, so nothing you already built will break. They are deprecated though: they now return a Deprecation header and a Link header pointing at their /api/v1/ successor. New integrations should use the versioned paths.
Embeddable widget
Drop a converter onto any page with an <iframe>. Swap kg-to-lb for any pair slug on the site. The attribution link below the frame is appreciated rather than required, and keeping it is the main thing that makes the widget worth publishing for free.
Copy this
<iframe src="https://unitglide.net/embed/kg-to-lb"
width="360" height="200" loading="lazy"
style="border:1px solid #e2e6ec;border-radius:12px"
title="Kg to Lbs converter"></iframe>
<p><a href="https://unitglide.net/convert/kg-to-lb">Kg to Lbs Converter</a> by UnitGlide</p>Result
Licence and attribution
Both the API and the widget are free for personal and commercial use, and there are two different rules depending on what you do with them.
- Republishing the reference data: attribution required. The conversion factors and the reference tables are published under CC BY 4.0. If you copy the numbers into your own pages, dataset, app or documentation, the licence requires credit: UnitGlide with a link to unitglide.net. Every
/api/v1/response repeats that in itslicenseandattributionfields so you can carry it through automatically. - Calling the API or embedding the widget: attribution appreciated. Showing a converted value in your own interface is normal use and needs no credit. A link back is genuinely appreciated and helps keep this free, but nothing is withheld if you leave it out.
Fair use
There is no key, no quota and no account. The documented fair-use expectation is up to 10 requests per second and 100,000 requests per day per project. To be plain about it: none of that is enforced. This site is fully static with no backend and no database, so there is no rate limiter, no counter and no way for us to cut anyone off. The figure is an expectation, not a technical limit.
If you need more than that, you almost certainly do not need the API at all: fetch /api/v1/factors once and do the arithmetic locally, which is faster and works offline. The service is provided as-is with no uptime guarantee. Bulk plans, or a question? Get in touch.
Spec and changelog
The machine-readable contract for the versioned endpoints is an OpenAPI 3.1 document at /api/openapi.json, which you can point a client generator or an API browser straight at. Dated versions, new endpoints and deprecations are listed on the API changelog.
Embed a reference table instead
Some pages want a table rather than an input box. The reference data pages each ship the same way: an <iframe> at /embed/reference/<slug> with the attribution built in, plus the full table on the page under a CC BY 4.0 licence if you would rather hold the numbers yourself. Two are published so far, the EU nutrition label energy factors and the decimal versus binary byte units.
How the numbers are derived
Every value the API and widget return comes from the exact SI and NIST factors documented on the methodology and sources page.