Wazli Maps Docs

Docs › Products

Directions

A route by car or on foot between two points, with turn-by-turn steps in English or Arabic, in miles or kilometres, avoiding tolls, highways, ferries or dirt roads.

What to send

POST https://map.wazli.com/api/maps/v1/directions with a key that has Directions and a JSON body of at most 4 KB:

FieldWhat it is
from, to{ lat, lng } each (needed).
mode"drive" (default) or "walk".
unit"mi" (default) or "km".
lang"en" (default) or "ar": the language of the steps.
avoidDriving only: a list of tolls, highways, ferries, dirt. Walking avoids nothing.

Driving routes go round roads that are closed right now.

What comes back

{ route }. When no road joins the two points, the answer is 404 no_route; every error is on map.wazli.com/developers/errors.

FieldWhat it is
distance, unitThe whole trip, in the unit asked for.
durationSecHow long it takes, in seconds.
geometryA GeoJSON LineString of [lng, lat] points to draw.
stepsThe turns, in order (below).
hasTolltrue when some of the trip is on toll roads.
viaThe one or two roads most of the trip is on.
Step fieldWhat it is
instructionWhat to do, in the language asked for.
typeThe kind of turn, as a Valhalla maneuver number (for an icon).
distance, durationSecThis step's length and time.
beginShapeIndexWhere the step starts on geometry (a point index).
streetThe road the step takes.
lanesThe lanes before the turn, left to right: { directions, active }.
exitNumberWhich roundabout exit to take.
exitSignWhat a highway exit's sign says: { number, branches, toward }.
Answer (shortened)
{
  "route": {
    "distance": 24.5667,
    "unit": "mi",
    "durationSec": 2078,
    "geometry": { "type": "LineString", "coordinates": [[-81.378772, 28.538071], ...] },
    "steps": [
      {
        "instruction": "Drive south on South Orange Avenue/SR 527.",
        "type": 2,
        "distance": 0.07,
        "durationSec": 10,
        "beginShapeIndex": 0,
        "street": "South Orange Avenue"
      },
      ...
      {
        "instruction": "Turn right onto Boone Avenue.",
        "type": 10,
        "distance": 0.1193,
        "durationSec": 23,
        "beginShapeIndex": 15,
        "street": "Boone Avenue",
        "lanes": [
          { "directions": ["left"] },
          { "directions": ["through"] },
          { "directions": ["through", "right"], "active": "right" }
        ]
      },
      ...
    ],
    "hasToll": false,
    "via": ["I 4 West", "Epcot Center Drive"]
  }
}

Example

curl
curl -X POST "https://map.wazli.com/api/maps/v1/directions" \
  -H "X-Wazli-Key: YOUR_SERVER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":{"lat":28.538,"lng":-81.379},"to":{"lat":28.4177,"lng":-81.5812},"mode":"drive","unit":"mi","avoid":["tolls"]}'