Docs › Products
Geocoding & reverse
Turn an address into a point, and a point back into an address, in English or Arabic: what to send, what comes back and copy-paste examples.
What to send
Both calls need a key with Geocoding, and both count as Geocoding. GET https://map.wazli.com/api/maps/v1/geocode takes:
| Parameter | What it is |
|---|---|
q | The text typed, 2 to 200 characters. Eastern Arabic digits (٠-٩) are read as 0-9. |
lang | "en" (default) or "ar": the language of names and addresses in the answer. |
near | lat,lng to rank close places first. |
limit | How many results, 1 to 10 (5 if left out). |
GET https://map.wazli.com/api/maps/v1/reverse takes:
| Parameter | What it is |
|---|---|
lat, lng | The point: lat -90 to 90, lng -180 to 180. |
lang | "en" (default) or "ar": the language of names and addresses in the answer. |
What comes back
geocode answers { results: Place[] }, best first; reverse answers { result: Place | null } (null when nothing is there). Each place:
| Field | What it is |
|---|---|
id | The place's id, or null. |
kind | What it is: house, street, city, state, postcode, poi, area. |
label | The whole line, ready to show. |
name, houseNumber, street, city, state, postcode, countryCode | The address's parts; each is null when unknown. |
lat, lng | The point (latitude, longitude). |
bbox | Areas only: [west, south, east, north]. |
Answer (shortened)
{
"results": [
{
"id": "osm:R7932667",
"kind": "city",
"label": "Disney Springs, Buena Vista, Florida, United States",
"name": "Disney Springs",
"houseNumber": null,
"street": null,
"city": "Buena Vista",
"state": "Florida",
"postcode": null,
"countryCode": "US",
"lat": 28.3711613,
"lng": -81.5183686,
"bbox": [-81.5238487, 28.368579, -81.5135581, 28.3737402]
}
]
}Reverse answer, in Arabic (shortened)
{
"result": {
"id": "osm:W483099091",
"kind": "city",
"label": "ساحة الفارس العربي, بلدية الكرخ, بغداد, العراق",
"name": "ساحة الفارس العربي",
"city": "بلدية الكرخ",
"state": "بغداد",
"countryCode": "IQ",
"lat": 33.3152208,
"lng": 44.3660773,
...
}
}Example
curl
curl "https://map.wazli.com/api/maps/v1/geocode?q=Disney%20Springs&limit=1" \
-H "X-Wazli-Key: YOUR_SERVER_KEY"curl
curl "https://map.wazli.com/api/maps/v1/reverse?lat=33.3152&lng=44.3661&lang=ar" \
-H "X-Wazli-Key: YOUR_SERVER_KEY"