GET /v1/geocode

Geocoding API for address and place search

Send the text a user typed (a street, a neighborhood, a shop or a landmark) and get back ranked places with coordinates, a structured address and the administrative areas around it, ready to feed into distance and routing calls.

Request and response

Copy, paste and run with your test key. The response below is an illustrative example.
curl "https://api.wayline.cloud/v1/geocode?q=Dhanmondi%2027&near=23.7925,90.4078&limit=1" \
  -H "Authorization: Bearer $WAYLINE_API_KEY"
Response (example)
{
  "results": [
    {
      "name": "Dhanmondi 27",
      "formatted_address": "Dhanmondi 27, Dhanmondi, Dhaka 1209, Bangladesh",
      "location": {
        "lat": 23.7465,
        "lng": 90.376
      },
      "type": "locality",
      "address": {
        "district": "Dhanmondi",
        "city": "Dhaka",
        "county": "Dhaka",
        "state": "Dhaka Division",
        "postcode": "1209",
        "country": "Bangladesh",
        "country_code": "BD"
      },
      "source": "osm"
    }
  ],
  "admin_areas": {
    "division": {
      "name": "Dhaka"
    },
    "district": {
      "name": "Dhaka"
    },
    "upazila": {
      "name": "Dhanmondi"
    }
  },
  "units_charged": 1,
  "region": "bd"
}

What the Geocoding API gives you

  • Built for search boxes

    Results are ranked by relevance and, when you pass near=lat,lng, by proximity to the user, so the right place shows up after a few keystrokes.

  • Structured addresses

    Every result has a formatted_address plus street, locality, district, city, postcode and country fields, and the OpenStreetMap object it came from.

  • Local names and spelling

    Pass lang=bn for Bengali names where OpenStreetMap has them. Place data is merged from OpenStreetMap, GeoNames and Overture Maps to fill rural gaps.

  • One unit per request

    A successful search costs one geocode unit, even when it returns no results. Errors are never billed.

How the Geocoding API works

Wayline runs its own geocoder on open data for each region that offers geocoding. A request searches one region, chosen from the near point or the region parameter, and returns up to 10 candidates. Combine it with the Distance or Distance Matrix API to go from typed addresses to real road distances and drive times in two calls.

Where geocoding is available

Geocoding is region-based, like routing. Bangladesh is covered today, including divisions, districts, upazilas, unions, villages and points of interest. The Coverage page lists every region and the services it offers.

Frequently asked questions

What data does the Geocoding API use?

OpenStreetMap (ODbL), with gaps filled from GeoNames (CC BY 4.0) and Overture Maps Places (CDLA Permissive 2.0). Each result says which dataset it came from. We never use Google or Mapbox data.

Can I use it for autocomplete?

Yes. Send the partial text as q and the user's location as near. Debounce keystrokes (around 200 ms) to keep request counts and cost down.

Which countries are covered?

Geocoding runs per region. Bangladesh is available today; more regions are added as their datasets are prepared. Requests for regions without geocoding return a clear error and are never billed.

How is geocoding billed?

One geocode unit per successful request at the price shown on the pricing page. New accounts get free units that cover every endpoint, geocoding included.

Start building in minutes

Create an account, grab a test key and make your first request in under five minutes.