← Toutes les opérations
POST/v1/route

Compute an itinerary (POST, JSON body)

Returns one or more itineraries between two (or more) points with a precision-6 encoded polyline, three verbal instruction variants per maneuver (pre/alert/post), and — when traffic data is available — an ML-enhanced ETA alongside the raw Valhalla duration.

Corps de la requête

Schéma : RouteRequest

JSONExemple
{
  "origin": {
    "lat": 5.3197,
    "lng": -4.0167
  },
  "destination": {
    "lat": 5.348,
    "lng": -3.9904
  },
  "mode": "auto",
  "language": "fr"
}

Réponses

  • 200Route(s) computed.

    object

  • 400Validation error.

    Error

  • 401Missing or invalid API key.
  • 429Rate limit exceeded.

Exemples de code

curl -X POST https://api.afrimap.ci/v1/route \
  -H "X-AfriMap-Key: $AFM_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origin":      { "lat": 5.3197, "lng": -4.0167 },
    "destination": { "lat": 5.3480, "lng": -3.9904 },
    "mode":        "auto",
    "language":    "fr"
  }'

Testez-le

Essayer en direct

POST /v1/route

Collez une clé sandbox afm_test_…. La requête part directement de votre navigateur vers le gateway, aucun proxy côté portail.

POST http://172.28.0.8:8090/v1/route