GA
API & MCPDoiciméadúchán

Ardán Gníomhairí agus API Road User Tools

Tiontaigh luasanna

Tiontaigh idir ciliméadar san uair, míle san uair, méadar in aghaidh an tsoicind, agus muirmhílte san uair.

Comhéadain

POST
Críochphointe REST/api/v1/speed/convert
MCP
Ainm uirliseconvert_speed

Iarratas

Seol an t-iarratas mar JSON. Pasann cliaint MCP na réimsí céanna le hargóintí uirlisí.

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"
}'
Comhlacht iarrataisjson
{
  "value": 60,
  "from": "mph",
  "to": "kmh"
}

Freagra

Fillteann REST an toradh ríofa sa chlúdach caighdeánach rathúlachta. Tugann MCP na sonraí ríofa céanna ar ais mar aschur struchtúrtha uirlise.

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
  }
}

Scéimeanna

Léiríonn na sainmhínithe thíos Scéimre JSON iomlán a úsáidtear chun ionchuir a bhailíochtú agus chun cur síos a dhéanamh ar aschuir.

Scéimre ionchuir

{
  "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"
  ]
}

Scéimre aschuir

{
  "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"
  ]
}
Doiciméid API & MCP