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/v1
GET
/api/v1/convert

Convert a single value between units.

Parameters

ParameterTypeDescription
valuenumberValue to convert
fromstringSource unit ID
tostringTarget 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_KEY

Option 2: X-API-Key Header

X-API-Key: YOUR_API_KEY
Supported 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.046226
Error Codes
HTTPCodeDescription
401unauthorizedMissing or invalid API key
400missing_parameterRequired parameter is missing
400invalid_parameterParameter value is invalid
400invalid_conversionCannot convert between the specified units
429rate_limit_exceededToo many requests, slow down
429quota_exceededMonthly quota exceeded, upgrade your plan

Ready to get started?

Create your free account and get 1,000 API requests per month.