HI
API & MCPदस्तावेज़ीकरण

Mariner GPS Tools डेवलपर प्लेटफ़ॉर्म

प्रारंभिक वास्तविक दिशा की गणना करें

दो बिंदुओं के बीच प्रारंभिक दिशा निकालें

इंटरफ़ेस

POST
REST समापन बिंदु/api/v1/bearing
MCP
उपकरण का नामcalculate_bearing

निवेदन

अनुरोध को JSON के रूप में भेजें। MCP क्लाइंट टूल तर्कों के समान फ़ील्ड पास करते हैं।

cURLshell
curl -X POST https://marinergps.tools/api/v1/bearing \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "from": {
    "lat": 50.1,
    "lng": -4.2
  },
  "to": {
    "lat": 49.8,
    "lng": -3.1
  }
}'
निकाय से अनुरोध करेंjson
{
  "from": {
    "lat": 50.1,
    "lng": -4.2
  },
  "to": {
    "lat": 49.8,
    "lng": -3.1
  }
}

प्रतिक्रिया

REST गणना परिणाम को मानक सफलता लिफाफे में लपेटता है। MCP संरचित टूल आउटपुट के समान गणना डेटा लौटाता है।

JSON
{
  "ok": true,
  "data": {
    "degrees": 112.54786806700503,
    "compass": "ESE"
  }
}

स्कीमा

नीचे दी गई परिभाषाएँ इनपुट को मान्य करने और आउटपुट का वर्णन करने के लिए उपयोग की जाने वाली संपूर्ण JSON स्कीमा दिखाती हैं।

इनपुट स्कीमा

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "from": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "lat": {
          "type": "string",
          "description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
        },
        "lng": {
          "type": "string",
          "description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
        }
      },
      "required": [
        "lat",
        "lng"
      ]
    },
    "to": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "lat": {
          "type": "string",
          "description": "Latitude as decimal degrees or a coordinate string such as 51° 30′ 26.4″ N."
        },
        "lng": {
          "type": "string",
          "description": "Longitude as decimal degrees or a coordinate string such as 0° 07′ 39″ W."
        }
      },
      "required": [
        "lat",
        "lng"
      ]
    }
  },
  "required": [
    "from",
    "to"
  ]
}

आउटपुट स्कीमा

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "degrees": {
      "type": "number"
    },
    "compass": {
      "type": "string"
    }
  },
  "required": [
    "degrees",
    "compass"
  ]
}
API और MCP दस्तावेज़