API Documentation
Unit Conversion API
Build powerful applications with our REST API for unit conversions
Convert between 13 categories and 100+ units programmatically. Flexible subscription plans with generous quotas, real-time conversions, and enterprise-grade reliability. Perfect for developers, apps, and integrations.
Subscription Plans
Choose the plan that fits your needs. All plans include the same API features.
Free
$0
1,000/mo
10/min
Starter
$5/mo
10,000/mo
30/min
Pro
$14/mo
50,000/mo
100/min
Business
$39/mo
250,000/mo
300/min
Quick Start
Get up and running in minutes
1
Get your API key
Sign up at the Developer Dashboard to create your API key.
2
Make your first request
Include your API key in the Authorization header:
curl "https://www.unitharbor.net/api/v1/convert?value=10&from=kg&to=lb" \ -H "Authorization: Bearer YOUR_API_KEY"
3
Parse the response
{
"result": {
"from": "kg",
"to": "lb",
"input": 10,
"output": 22.046226,
"category": "mass"
},
"meta": {
"plan": "free",
"timestamp": "2025-01-15T12:00:00.000Z"
}
}API Reference
Base URL:
https://www.unitharbor.net/api/v1GET
/api/v1/convertConvert a single value between units.
Parameters
| Parameter | Type | Description |
|---|---|---|
| value | number | Value to convert |
| from | string | Source unit ID |
| to | string | Target unit ID |
Authentication
All API requests require authentication. Include your API key in the Authorization header.
Option 1: Authorization Header (Recommended)
Authorization: Bearer YOUR_API_KEYOption 2: X-API-Key Header
X-API-Key: YOUR_API_KEYSupported Categories
13 categories with 100+ units
length
mm
cm
m
km
in
ft
yd
mi
nmi
area
mm2
cm2
m2
ha
km2
in2
ft2
yd2
ac
mi2
volume
mm3
cm3
ml
l
m3
tsp
tbsp
floz
cup
pt
qt
gal
mass
mg
g
kg
t
oz
lb
st
ton
temperature
C
F
K
R
speed
m/s
km/h
mph
kn
ft/s
time
ns
mu
ms
s
min
h
d
week
month
year
pressure
Pa
hPa
kPa
MPa
bar
torr
psi
atm
energy
J
kJ
Wh
kWh
cal
kcal
BTU
power
W
kW
MW
hp
data
b
Kb
Mb
Gb
Tb
B
KB
MB
GB
TB
frequency
Hz
kHz
MHz
GHz
angle
deg
rad
grad
arcmin
arcsec
Live API Sandbox
Test the API with a demo conversion
Code Examples
const response = await fetch('https://www.unitharbor.net/api/v1/convert?value=10&from=kg&to=lb', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data.result.output); // 22.046226Error Codes
| HTTP | Code | Description |
|---|---|---|
| 401 | unauthorized | Missing or invalid API key |
| 400 | missing_parameter | Required parameter is missing |
| 400 | invalid_parameter | Parameter value is invalid |
| 400 | invalid_conversion | Cannot convert between the specified units |
| 429 | rate_limit_exceeded | Too many requests, slow down |
| 429 | quota_exceeded | Monthly quota exceeded, upgrade your plan |