GET/v1/units
Every unit the converter knows, grouped by category
PARAMETERS
- categoryquery · enum
- Only this categoryone of: length, mass, temperature, volume, area, speed, time, data, energy, pressure, power
REQUEST
curl "https://api.apialmanac.com/v1/units" \ -H "X-API-Key: YOUR_KEY"
import requests
r = requests.get("https://api.apialmanac.com/v1/units", headers={"X-API-Key": "YOUR_KEY"})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.apialmanac.com/v1/units", {
headers: { "X-API-Key": "YOUR_KEY" }
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"categories": [
{
"category": "temperature",
"base": "c",
"units": [
{
"id": "c",
"label": "degree Celsius",
"aliases": [
"°c",
"celsius",
"centigrade",
"degc"
]
},
{
"id": "f",
"label": "degree Fahrenheit",
"aliases": [
"°f",
"fahrenheit",
"degf"
]
},
{
"id": "k",
"label": "kelvin",
"aliases": [
"kelvin",
"kelvins"
]
}
]
}
]
}