# Unit Converter API
> Fast, deterministic unit conversion across 10 categories — length, mass, temperature, area, volume, speed, time, digital storage, pressure and energy. Convert any value between compatible units and list the full unit catalog per category. Fully local compute (no third-party upstream), so responses are instant and always available. Ideal for calculators, e-commerce, logistics, engineering tools, dashboards and chatbots.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/unit-api/..."
```

## Pricing
- **Free** (Free) — 12,000 calls/Mo, 3 req/s
- **Basic** ($5/Mo) — 350,000 calls/Mo, 15 req/s
- **Pro** ($17/Mo) — 2,000,000 calls/Mo, 50 req/s
- **Mega** ($44/Mo) — 10,000,000 calls/Mo, 150 req/s

## Endpoints

### Unit

#### `GET /v1/convert` — Convert a value between units

**Parameters:**
- `value` (query, required, string) — Numeric value to convert Example: `100`
- `from` (query, required, string) — Source unit Example: `c`
- `to` (query, required, string) — Target unit (same category) Example: `f`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unit-api/v1/convert?value=100&from=c&to=f"
```

**Response:**
```json
{
    "data": {
        "to": "f",
        "from": "c",
        "value": 100,
        "result": 212,
        "category": "temperature"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:26.239Z",
        "request_id": "9e109eac-a409-4a38-abe7-596b76010011"
    },
    "status": "ok",
    "message": "Value converted",
    "success": true
}
```

#### `GET /v1/units` — List supported units

**Parameters:**
- `category` (query, optional, string) — Filter to one category Example: `length`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/unit-api/v1/units?category=length"
```

**Response:**
```json
{
    "data": {
        "units": [
            "m",
            "km",
            "dm",
            "cm",
            "mm",
            "um",
            "nm",
            "mi",
            "yd",
            "ft",
            "in",
            "nmi",
            "ly"
        ],
        "category": "length"
    },
    "meta": {
        "timestamp": "2026-05-30T09:00:26.300Z",
        "request_id": "1852e82b-d646-4b2f-8c80-8cd25d396d7c"
    },
    "status": "ok",
    "message": "Units retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/unit-api
OpenAPI spec: https://www.oanor.com/api/unit-api/openapi.json
