Road User Tools Aracı ve API Platformu
Hızları dönüştür
Kilometre/saat, mil/saat, metre/saniye ve knot arasında dönüşüm yapın.
Arayüzler
POST
REST uç noktası
/api/v1/speed/convertMCP
Araç adı
convert_speedTalep
İsteği JSON olarak gönderin. MCP istemcileri, araç bağımsız değişkenleriyle aynı alanları iletir.
cURLshell
curl -X POST https://roaduser.tools/api/v1/speed/convert \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"value": 60,
"from": "mph",
"to": "kmh"
}'Talep gövdesijson
{
"value": 60,
"from": "mph",
"to": "kmh"
}Yanıt
REST hesaplama sonucunu standart başarı zarfına sarar. MCP, yapılandırılmış araç çıktısıyla aynı hesaplama verilerini döndürür.
JSON
{
"ok": true,
"data": {
"input": {
"value": 60,
"from": "mph",
"to": "kmh"
},
"conversions": {
"kmh": 96.56063999999999,
"mph": 60,
"ms": 26.8224,
"kn": 52.13857451403887
},
"result": 96.56063999999999
}
}{
"ok": false,
"error": {
"code": "invalid_request",
"message": "Invalid request input."
}
}Şemalar
Aşağıdaki tanımlar, girişleri doğrulamak ve çıkışları tanımlamak için kullanılan JSON Şemasının tamamını gösterir.
Girdi şeması
{
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number",
"description": "Speed value to convert."
},
"from": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
],
"description": "Input speed unit."
},
"to": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
],
"description": "Optional target unit. When omitted, all units are returned."
}
},
"required": [
"value",
"from"
]
}Çıktı şeması
{
"type": "object",
"additionalProperties": false,
"properties": {
"input": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number"
},
"from": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
]
},
"to": {
"type": "string",
"enum": [
"kmh",
"mph",
"ms",
"kn"
]
}
},
"required": [
"value",
"from"
]
},
"conversions": {
"type": "object",
"additionalProperties": false,
"properties": {
"kmh": {
"type": "number"
},
"mph": {
"type": "number"
},
"ms": {
"type": "number"
},
"kn": {
"type": "number"
}
},
"required": [
"kmh",
"mph",
"ms",
"kn"
]
},
"result": {
"type": "number",
"description": "Target-unit result when a target unit is supplied."
}
},
"required": [
"input",
"conversions"
]
}