How do I authenticate with this API?
Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.
Length, mass, volume, temperature, time, digital, speed, area, energy, power, pressure. 100+ units across 11 categories — single conversion or batches of 50. Precision dial 0–15.
Why Unit Conversion API
/api/v1/unit-conversion
One conversion route, two discovery routes, two ops routes. Mix GET and POST as your tooling prefers.
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | yes | Source unit identifier (e.g. "kg", "m", "°C"). |
| to | string | yes | Target unit identifier — must be in the same category. |
| value | number | yes | Numeric value to convert. Range: −1e15 to 1e15. |
| precision | integer | no | Decimal places for result rounding (0–15). Default: no rounding. |
| reverse | boolean | no | Swap from/to (default false). Handy for symmetric workflows. |
| api_key | string | yes | API key via query string. Alternatively pass as x-api-key header. |
Use GET for quick conversions in tooling, POST for batched workloads.
GET https://datpaq.com/api/v1/unit-conversion/convert?api_key=YOUR_API_KEY\ &from=kg&to=lb&value=5&precision=2
POST https://datpaq.com/api/v1/unit-conversion/convert
Content-Type: application/json
[
{ "from": "km", "to": "mi", "value": 10, "precision": 4 },
{ "from": "L", "to": "ml", "value": 3 },
{ "from": "C", "to": "F", "value": 25, "precision": 1 }
]Error reference
Every error response includes a correlationId for request tracing and a clear error message.
{
"success": false,
"error": "Incompatible unit types: 'kg' ↔ 'm'",
"correlationId": "conv-error123"
}FAQ
Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.
Yes. Datpaq APIs include a free tier for building, testing, and small production workloads before you move to a paid plan.
Datpaq APIs use REST over HTTPS and return JSON by default. Endpoint docs show the supported methods, query parameters, request bodies, and response fields.
Each API documents rate limits, validation rules, and error responses in the landing page and API docs so integrations can retry and fail cleanly.
11 categories, 100+ unit identifiers, precision dial 0-15. One GET for ad-hoc, one POST for batches of 50.