POST
math
unit_convert
1 creditConvert between units of length, weight, temperature, speed, data, and more
Endpoint
POST /api/v1/tools/math/unit_convert
Body Parameters
value
number
required
to_unit
string
required
from_unit
string
required
Example
input
Request
{
"value": 100,
"to_unit": "mile",
"from_unit": "km"
}
output
Response
{
"result": 62.13711922373339,
"formula": "100.0 km \u2192 mile",
"to_unit": "mile",
"from_unit": "km"
}
Response Format
HTTP/1.1 200 OK
SUCCESS
{
"success": true,
"data": {
"result": 62.13711922373339,
"formula": "100.0 km \u2192 mile",
"to_unit": "mile",
"from_unit": "km"
},
"meta": {
"tool": "unit_convert",
"credits_consumed": 1
}
}
HTTP/1.1 422 Unprocessable Entity
ERROR
{
"success": false,
"data": null,
"error": {
"code": "validation_error",
"message": "The given data was invalid."
}
}
Sign in to try this tool directly from the docs.
Code Examples
Request Example
lightbulb
Developer Tip
Credits are deducted before execution. If the upstream tool fails, credits are automatically refunded to your account.