API Documentation
RESTful API for programmatic unit conversions.
Base URL: /api/v1
OpenAPI: /api/v1/openapi.json
Endpoints
GET
/api/v1/convert
Convert a value from one unit to another.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
category | string | Category slug (e.g., length, temperature) |
from | string | Source unit symbol (e.g., km, C) |
to | string | Target unit symbol (e.g., mi, F) |
value | number | The numeric value to convert |
Example
curl "https://units.30twelve.org/api/v1/convert?category=length&from=km&to=mi&value=5"
Response
{
"from": { "value": 5.0, "unit": "km", "name": "Kilometer" },
"to": { "value": 3.106856, "unit": "mi", "name": "Mile" },
"base_value": 5000.0,
"base_unit": "m",
"base_unit_name": "Meter",
"formula": "km × 0.621371",
"definition_version": "2026-02-09",
"sources": ["BIPM SI Brochure (9th ed.)"]
}
POST
/api/v1/convert-batch
Convert arrays of values or submit a list of conversion requests.
Example
curl -X POST "https://units.30twelve.org/api/v1/convert-batch" \\
-H "Content-Type: application/json" \\
-d '{"category":"length","from":"m","to":"ft","values":[1,2,3]}'
GET
/api/v1/categories
List all available converter categories grouped by section.
Example
curl "https://units.30twelve.org/api/v1/categories"
GET
/api/v1/categories/{slug}/units
List all units available for a specific category.
Example
curl "https://units.30twelve.org/api/v1/categories/temperature/units"
Response
{
"category": "temperature",
"name": "Temperature",
"units": [
{ "name": "Celsius", "symbol": "C" },
{ "name": "Fahrenheit", "symbol": "F" },
{ "name": "Kelvin", "symbol": "K" },
{ "name": "Rankine", "symbol": "R" }
]
}
Available Categories
| Slug | Name |
|---|---|
length |
Length & Distance |
weight |
Mass & Weight |
volume |
Volume |
temperature |
Temperature |
area |
Area |
pressure |
Pressure |
energy |
Energy |
power |
Power |
time |
Time |
speed |
Speed |
cooking |
Cooking & Recipe |
shoe-size |
Shoe Size |
color |
Color |
force |
Force |
fuel-consumption |
Fuel Consumption |
data-storage |
Data Storage |
currency |
Currency |
acceleration |
Acceleration |
density |
Density |
moment-of-inertia |
Moment of Inertia |
torque |
Torque |
angle |
Angle |
numbers |
Numbers |
volume-dry |
Volume - Dry |
velocity-angular |
Velocity - Angular |
acceleration-angular |
Acceleration - Angular |
specific-volume |
Specific Volume |
moment-of-force |
Moment of Force |
fuel-efficiency-mass |
Fuel Efficiency - Mass |
fuel-efficiency-volume |
Fuel Efficiency - Volume |
temperature-interval |
Temperature Interval |
thermal-expansion |
Thermal Expansion |
thermal-resistance |
Thermal Resistance |
thermal-conductivity |
Thermal Conductivity |
specific-heat-capacity |
Specific Heat Capacity |
heat-density |
Heat Density |
heat-flux-density |
Heat Flux Density |
heat-transfer-coefficient |
Heat Transfer Coefficient |
flow |
Flow |
flow-mass |
Flow - Mass |
flow-molar |
Flow - Molar |
mass-flux-density |
Mass Flux Density |
concentration-molar |
Concentration - Molar |
concentration-solution |
Concentration - Solution |
viscosity-dynamic |
Viscosity - Dynamic |
viscosity-kinematic |
Viscosity - Kinematic |
surface-tension |
Surface Tension |
permeability |
Permeability |
magnetomotive-force |
Magnetomotive Force |
magnetic-field-strength |
Magnetic Field Strength |
magnetic-flux |
Magnetic Flux |
magnetic-flux-density |
Magnetic Flux Density |
luminance |
Luminance |
luminous-intensity |
Luminous Intensity |
illumination |
Illumination |
digital-image-resolution |
Digital Image Resolution |
frequency-wavelength |
Frequency Wavelength |
charge |
Charge |
linear-charge-density |
Linear Charge Density |
surface-charge-density |
Surface Charge Density |
volume-charge-density |
Volume Charge Density |
current |
Current |
linear-current-density |
Linear Current Density |
surface-current-density |
Surface Current Density |
electric-field-strength |
Electric Field Strength |
electric-potential |
Electric Potential |
electric-resistance |
Electric Resistance |
electric-resistivity |
Electric Resistivity |
electric-conductance |
Electric Conductance |
electric-conductivity |
Electric Conductivity |
electrostatic-capacitance |
Electrostatic Capacitance |
inductance |
Inductance |
Notes
- Temperature conversions use formulas (not simple multiplication), so they handle non-linear scales correctly (e.g., 0°C = 32°F).
- All other categories use multiplication through a base SI unit. The
base_valueandbase_unitfields show the intermediate value. - Results are rounded to 6 significant digits.
- Rate limit: 120 requests per minute per IP.
- Responses include
definition_versionandsourcesfor transparency. - Unit aliases are accepted (e.g.,
micron→µm,kph→km/h,lbm→lb).