{"openapi":"3.1.0","info":{"title":"Wazli Maps API","version":"1","description":"Maps, address search, nearby places and directions, in English and Arabic. Docs: https://map.wazli.com/developers. Version 1 only ever adds: nothing is renamed or removed, so read answers leniently (new fields and new error codes may appear). Every call can answer the statuses listed on it: 404 not_found on any call means the service is switched off (on /styles/{name} it also means no style has that name); 404 no_route comes only from /directions."},"servers":[{"url":"https://map.wazli.com/api/maps/v1"}],"externalDocs":{"url":"https://map.wazli.com/developers"},"security":[{"KeyQuery":[]},{"KeyHeader":[]}],"tags":[{"name":"Map"},{"name":"Map styles"},{"name":"Autocomplete"},{"name":"Geocoding"},{"name":"Nearby"},{"name":"Directions"}],"paths":{"/style.json":{"get":{"summary":"The map: a MapLibre style on tiles.wazli.com","tags":["Map"],"description":"Its sources are pmtiles:// addresses, so plain MapLibre must register the PMTiles protocol (the website kit does this for you).","parameters":[{"$ref":"#/components/parameters/Lang"},{"name":"look","in":"query","required":false,"description":"The map's look.","schema":{"type":"string","enum":["light","dark"],"default":"light"}},{"name":"style","in":"query","required":false,"description":"One of the account's Map styles; its base replaces look.","schema":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])$"}},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"A MapLibre style (version 8). Not cached: each load counts one map load.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MapStyle"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/styles":{"get":{"summary":"Every Map style on the account","tags":["Map styles"],"description":"Needs a server key with the Map styles product.","parameters":[{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"The account's styles.","content":{"application/json":{"schema":{"type":"object","required":["styles"],"properties":{"styles":{"type":"array","items":{"$ref":"#/components/schemas/StyleView"}}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/styles/{name}":{"get":{"summary":"One Map style","tags":["Map styles"],"description":"Needs a server key with the Map styles product.","parameters":[{"name":"name","in":"path","required":true,"description":"The style's name.","schema":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])$"}},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"The style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleAnswer"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}},"put":{"summary":"Make or replace a Map style","tags":["Map styles"],"description":"Needs a server key with the Map styles product. At most 20 styles per account; the body is at most 4 KB.","parameters":[{"name":"name","in":"path","required":true,"description":"The style's name.","schema":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])$"}},{"$ref":"#/components/parameters/App"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandStyle"}}}},"responses":{"200":{"description":"The saved style.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StyleAnswer"}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}},"delete":{"summary":"Delete a Map style","tags":["Map styles"],"description":"Needs a server key with the Map styles product.","parameters":[{"name":"name","in":"path","required":true,"description":"The style's name.","schema":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])$"}},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"Deleted.","content":{"application/json":{"schema":{"type":"object","required":["deleted"],"properties":{"deleted":{"const":true}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/autocomplete":{"get":{"summary":"Address suggestions while people type","tags":["Autocomplete"],"parameters":[{"name":"q","in":"query","required":true,"description":"The text typed. Eastern Arabic digits are read as 0-9.","schema":{"type":"string","minLength":2,"maxLength":200}},{"$ref":"#/components/parameters/Lang"},{"name":"near","in":"query","required":false,"description":"lat,lng to rank close places first.","schema":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?$"}},{"name":"limit","in":"query","required":false,"description":"How many results.","schema":{"type":"integer","minimum":1,"maximum":10,"default":5}},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"Places, best first.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Place"}}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/geocode":{"get":{"summary":"An address to places","tags":["Geocoding"],"parameters":[{"name":"q","in":"query","required":true,"description":"The text typed. Eastern Arabic digits are read as 0-9.","schema":{"type":"string","minLength":2,"maxLength":200}},{"$ref":"#/components/parameters/Lang"},{"name":"near","in":"query","required":false,"description":"lat,lng to rank close places first.","schema":{"type":"string","pattern":"^-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?$"}},{"name":"limit","in":"query","required":false,"description":"How many results.","schema":{"type":"integer","minimum":1,"maximum":10,"default":5}},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"Places, best first.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Place"}}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/reverse":{"get":{"summary":"A point to an address (counts as Geocoding)","tags":["Geocoding"],"parameters":[{"name":"lat","in":"query","required":true,"description":"Latitude.","schema":{"type":"number","minimum":-90,"maximum":90}},{"name":"lng","in":"query","required":true,"description":"Longitude.","schema":{"type":"number","minimum":-180,"maximum":180}},{"$ref":"#/components/parameters/Lang"},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"The place at the point, or null.","content":{"application/json":{"schema":{"type":"object","required":["result"],"properties":{"result":{"oneOf":[{"$ref":"#/components/schemas/Place"},{"type":"null"}]}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/nearby":{"get":{"summary":"Places of one kind around a point","tags":["Nearby"],"parameters":[{"name":"lat","in":"query","required":true,"description":"Latitude.","schema":{"type":"number","minimum":-90,"maximum":90}},{"name":"lng","in":"query","required":true,"description":"Longitude.","schema":{"type":"number","minimum":-180,"maximum":180}},{"name":"type","in":"query","required":true,"description":"What kind of place.","schema":{"type":"string","enum":["fuel","hospital","atm","pharmacy","cafe","mosque","restaurant","fast_food","supermarket","hotel","parking","bank"]}},{"name":"radius","in":"query","required":false,"description":"How far to look: up to 15 mi or 25 km (the maximum of 25 is the km limit; with mi it is 15).","schema":{"type":"number","minimum":0.1,"maximum":25,"default":1}},{"name":"unit","in":"query","required":false,"description":"For radius and the distances that come back. radius goes up to 15 with mi and 25 with km.","schema":{"type":"string","enum":["mi","km"],"default":"mi"}},{"name":"limit","in":"query","required":false,"description":"How many places.","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}},{"$ref":"#/components/parameters/Lang"},{"$ref":"#/components/parameters/App"}],"responses":{"200":{"description":"Places, closest first.","content":{"application/json":{"schema":{"type":"object","required":["results"],"properties":{"results":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Place"},{"type":"object","required":["distance"],"properties":{"distance":{"type":"number","description":"In the unit asked for, to 2 decimals."}}}]}}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}},"/directions":{"post":{"summary":"A route by car or on foot","tags":["Directions"],"description":"Driving routes go round roads closed right now. The body is at most 4 KB.","parameters":[{"$ref":"#/components/parameters/App"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectionsAsk"}}}},"responses":{"200":{"description":"The route. No road between the points answers 404 no_route.","content":{"application/json":{"schema":{"type":"object","required":["route"],"properties":{"route":{"$ref":"#/components/schemas/Route"}}}}}},"400":{"$ref":"#/components/responses/Error400"},"401":{"$ref":"#/components/responses/Error401"},"403":{"$ref":"#/components/responses/Error403"},"404":{"$ref":"#/components/responses/Error404"},"429":{"$ref":"#/components/responses/Error429"},"503":{"$ref":"#/components/responses/Error503"}}}}},"components":{"securitySchemes":{"KeyQuery":{"type":"apiKey","in":"query","name":"key","description":"Your Wazli Maps key (wzm_ and 40 hex characters)."},"KeyHeader":{"type":"apiKey","in":"header","name":"X-Wazli-Key","description":"The same key as a header."}},"parameters":{"App":{"name":"X-Wazli-App","in":"header","required":false,"description":"Phone apps only: the app id on the key (for example com.example.myapp).","schema":{"type":"string"}},"Lang":{"name":"lang","in":"query","required":false,"description":"\"en\" (default) or \"ar\".","schema":{"type":"string","enum":["en","ar"],"default":"en"}}},"responses":{"Error400":{"description":"bad_request: The request is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error401":{"description":"missing_key: Send your key as ?key= or in the X-Wazli-Key header. | invalid_key: This key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error403":{"description":"not_allowed_here: This key may not be used from this website or app. | server_key_in_browser: This is a server key: keep it secret on your server. A web page needs a website key. | api_not_enabled: This key is not for this API. | account_suspended: This key's account is suspended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error404":{"description":"not_found: Not found. | no_route: No route joins these two points.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error429":{"description":"over_daily_limit: This key reached its daily limit for this API (UTC day). | too_many_requests: Too many calls in a minute; slow down.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Error503":{"description":"unavailable: The map service is unavailable right now; try again shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["bad_request","missing_key","invalid_key","not_allowed_here","server_key_in_browser","api_not_enabled","account_suspended","not_found","no_route","over_daily_limit","too_many_requests","unavailable"],"description":"Today's codes. New codes may be added: treat an unknown one by its HTTP status."},"message":{"type":"string"},"messageAr":{"type":"string","description":"The standard message in Arabic (left out when the message is about this call's input)."}}}}},"Place":{"type":"object","required":["id","kind","label","name","houseNumber","street","city","state","postcode","countryCode","lat","lng"],"properties":{"id":{"type":["string","null"]},"kind":{"type":"string","enum":["house","street","city","state","postcode","poi","area"],"description":"New values may be added."},"label":{"type":"string","description":"The whole line, ready to show."},"name":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"street":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postcode":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"lat":{"type":"number"},"lng":{"type":"number"},"bbox":{"type":"array","items":{"type":"number"},"minItems":4,"maxItems":4,"description":"Areas only: [west, south, east, north]."}}},"DirectionsAsk":{"type":"object","required":["from","to"],"properties":{"from":{"$ref":"#/components/schemas/LatLng"},"to":{"$ref":"#/components/schemas/LatLng"},"mode":{"type":"string","enum":["drive","walk"],"default":"drive"},"unit":{"type":"string","enum":["mi","km"],"default":"mi"},"lang":{"type":"string","enum":["en","ar"],"default":"en"},"avoid":{"description":"Driving only; walking avoids nothing. A list, or the same words joined by commas.","oneOf":[{"type":"array","items":{"type":"string","enum":["tolls","highways","ferries","dirt"]}},{"type":"string"}]}}},"LatLng":{"type":"object","required":["lat","lng"],"properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}}},"Route":{"type":"object","required":["distance","unit","durationSec","geometry","steps","hasToll","via"],"properties":{"distance":{"type":"number","description":"The whole trip, in unit."},"unit":{"type":"string","enum":["mi","km"]},"durationSec":{"type":"number"},"geometry":{"type":"object","required":["type","coordinates"],"properties":{"type":{"const":"LineString"},"coordinates":{"type":"array","items":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"description":"[lng, lat] points."}}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/RouteStep"}},"hasToll":{"type":"boolean"},"via":{"type":"array","items":{"type":"string"},"description":"The one or two roads most of the trip is on."}}},"RouteStep":{"type":"object","required":["instruction","type","distance","durationSec"],"properties":{"instruction":{"type":"string"},"type":{"type":"integer","description":"A Valhalla maneuver type."},"distance":{"type":"number"},"durationSec":{"type":"number"},"beginShapeIndex":{"type":"integer","description":"Where the step starts on geometry."},"street":{"type":"string"},"lanes":{"type":"array","items":{"type":"object","required":["directions"],"properties":{"directions":{"type":"array","items":{"type":"string","enum":["none","through","sharp_left","left","slight_left","slight_right","right","sharp_right","reverse","merge_left","merge_right"],"description":"New values may be added."}},"active":{"type":"string"}}}},"exitNumber":{"type":"integer","description":"Which roundabout exit."},"exitSign":{"type":"object","required":["branches","toward"],"properties":{"number":{"type":"string"},"branches":{"type":"array","items":{"type":"string"}},"toward":{"type":"array","items":{"type":"string"}}}}}},"BrandStyle":{"type":"object","required":["base"],"additionalProperties":false,"properties":{"base":{"type":"string","enum":["light","dark"]},"colors":{"type":"object","properties":{"land":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"water":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"parks":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"buildings":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"streets":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"mainRoads":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"highways":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"roadEdges":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"labels":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"labelOutline":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"}},"additionalProperties":false},"show":{"type":"object","properties":{"places":{"type":"boolean"},"buildings":{"type":"boolean"},"houseNumbers":{"type":"boolean"}},"additionalProperties":false},"hidePlaces":{"type":"array","items":{"type":"string","enum":["restaurant","fast_food","cafe","bakery","ice_cream","supermarket","convenience","place_of_worship","school","kindergarten","college","university","library","hospital","clinic","doctors","pharmacy","fuel","car_wash","car_repair","charging_station","mall","jewelry","hairdresser","beauty","books","clothes","electronics","park","garden","golf_course","fitness_centre","sports_centre","stadium","beach","forest","marina","peak","hotel","attraction","theme_park","water_park","zoo","museum","theatre","cinema","artwork","animal","bank","post_office","townhall","aerodrome","station","bus_stop","ferry_terminal","police","fire_station","courthouse","bus_station","government","diplomatic","monument","memorial","ruins","archaeological_site","castle","city_gate"]}}}},"StyleView":{"type":"object","required":["name","base","status","updatedAt"],"properties":{"name":{"type":"string"},"base":{"type":"string","enum":["light","dark"]},"colors":{"type":"object","properties":{"land":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"water":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"parks":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"buildings":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"streets":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"mainRoads":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"highways":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"roadEdges":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"labels":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"},"labelOutline":{"type":"string","pattern":"^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"}}},"show":{"type":"object","properties":{"places":{"type":"boolean"},"buildings":{"type":"boolean"},"houseNumbers":{"type":"boolean"}}},"hidePlaces":{"type":"array","items":{"type":"string","enum":["restaurant","fast_food","cafe","bakery","ice_cream","supermarket","convenience","place_of_worship","school","kindergarten","college","university","library","hospital","clinic","doctors","pharmacy","fuel","car_wash","car_repair","charging_station","mall","jewelry","hairdresser","beauty","books","clothes","electronics","park","garden","golf_course","fitness_centre","sports_centre","stadium","beach","forest","marina","peak","hotel","attraction","theme_park","water_park","zoo","museum","theatre","cinema","artwork","animal","bank","post_office","townhall","aerodrome","station","bus_stop","ferry_terminal","police","fire_station","courthouse","bus_station","government","diplomatic","monument","memorial","ruins","archaeological_site","castle","city_gate"]}},"status":{"type":"string","enum":["active","off"],"description":"\"off\": the Wazli team switched it off; maps draw its base look. New values may be added."},"updatedAt":{"type":"string","format":"date-time"}}},"StyleAnswer":{"type":"object","required":["style"],"properties":{"style":{"$ref":"#/components/schemas/StyleView"}}},"MapStyle":{"type":"object","required":["version","sources","layers"],"description":"A MapLibre style (https://maplibre.org/maplibre-style-spec/).","properties":{"version":{"const":8}}}}}}