Mariner GPS Tools Geliştirici Platformu
İlk gerçek kerterizi hesapla
İki nokta arasındaki ilk kerterizi hesapla
Arayüzler
POST
REST uç noktası
/api/v1/bearingMCP
Araç adı
calculate_bearingTalep
İsteği JSON olarak gönderin. MCP istemcileri, araç bağımsız değişkenleriyle aynı alanları iletir.
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
}
}'Talep gövdesijson
{
"from": {
"lat": 50.1,
"lng": -4.2
},
"to": {
"lat": 49.8,
"lng": -3.1
}
}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": {
"degrees": 112.54786806700503,
"compass": "ESE"
}
}{
"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": {
"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"
]
}Çıktı şeması
{
"type": "object",
"additionalProperties": false,
"properties": {
"degrees": {
"type": "number"
},
"compass": {
"type": "string"
}
},
"required": [
"degrees",
"compass"
]
}