Documentation menu
Search docs…⌘K

API reference

Address and place name for a coordinate

Returns the address or place at (or nearest to) a `lat,lng` coordinate, closest first, from OpenStreetMap data, plus the administrative areas containing the point (`admin_areas`; in Bangladesh division, district, upazila and union). When `radius_meters` is not set and nothing is found within about 1 km (sparse rural areas), the search widens to 5 km once. Use it to show a human-readable location for a GPS fix or a pin dropped on a map. Billed as one `reverse_geocode` unit per successful request (an empty `results` list is a successful answer). `summary` flattens the closest match and the admin areas into the fields most apps display (`house_number`, `road`, `neighbourhood`, `suburb`, `city`, `upazila`, `district`, `division`, `postcode`), with `distance_meters` to the match and a `label` that is honest about distance: "Near House 11, Road No. 14, Sobhanbag, Dhaka" or "1.2 km from Sobhanbag, Dhaka".

Endpoint

GEThttps://api.wayline.cloud/v1/reverse-geocode
Bearer Auth

Requires an API key (authentication). Product overview: Reverse Geocoding API. Billing: see units & pricing.

Parameters

NameInTypeDescription
pointrequiredqueryPointStringCoordinate, formatted as lat,lng.
limitqueryintegerNumber of results (1 to 5).Default: 1
radius_metersqueryintegerOnly return places within this distance of the point (1 to 5000).
near_metersqueryintegersummary.label says "Near …" only when the closest match is within this distance; otherwise it reads "1.2 km from <area>". Default 150. Default: 150
langquerystringResult language. en (default) or bn (Bengali, where OpenStreetMap has Bengali names).One of: en, bnDefault: en
typesquerystringComma-separated place types to return, e.g. street,locality,district,city to skip shops and other points of interest. Allowed: house (buildings and points of interest), street, locality, district, city, county, state, country, other.

Example

curl "https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376" \
  -H "Authorization: Bearer $WAYLINE_API_KEY"
Response (example)
{
  "results": [
    {
      "formatted_address": "Road 27, Dhanmondi, Dhaka 1209, Bangladesh",
      "location": {
        "lat": 23.7465,
        "lng": 90.376
      },
      "type": "street",
      "address": {
        "street": "Road 27",
        "district": "Dhanmondi",
        "city": "Dhaka",
        "county": "Dhaka",
        "state": "Dhaka Division",
        "postcode": "1209",
        "country": "Bangladesh",
        "country_code": "BD"
      },
      "distance_meters": 12,
      "source": "osm"
    }
  ],
  "admin_areas": {
    "division": {
      "name": "Dhaka"
    },
    "district": {
      "name": "Dhaka"
    },
    "upazila": {
      "name": "Dhanmondi"
    }
  },
  "summary": {
    "label": "Near Road 27, Dhanmondi, Dhaka",
    "near": true,
    "distance_meters": 12,
    "road": "Road 27",
    "suburb": "Dhanmondi",
    "city": "Dhaka",
    "upazila": "Dhanmondi",
    "district": "Dhaka",
    "division": "Dhaka",
    "postcode": "1209",
    "country": "Bangladesh"
  },
  "units_charged": 1,
  "region": "bd"
}

Response

200 — Geocoding results.

Response fields
FieldTypeDescription
resultsrequiredPlace[]
results[].namestring
results[].formatted_addressrequiredstring
results[].locationrequiredPointFlexible coordinate input accepted as string, object, or array.
results[].typerequiredstringOne of: house, street, locality, district, city, county, state, country, other
results[].categorystringOpenStreetMap key:value, e.g. amenity:hospital.
results[].addressrequiredPlaceAddressStructured address. Components without data are omitted.
results[].address.house_numberstring
results[].address.streetstring
results[].address.localitystringNeighbourhood or mahalla.
results[].address.districtstringCity area, e.g. Dhanmondi.
results[].address.citystring
results[].address.countystringIn Bangladesh: zila (district).
results[].address.statestringIn Bangladesh: division.
results[].address.postcodestring
results[].address.countrystring
results[].address.country_codestringISO 3166-1 alpha-2, upper case.
results[].distance_metersintegerStraight-line distance from the query point (reverse geocoding only).
results[].bounding_boxnumber[][min_lat, min_lng, max_lat, max_lng] for areas and long features.
results[].admin_areasAdminAreasAdministrative areas containing a point, keyed by level, largest first. In Bangladesh: division, district, upazila, union. OpenStreetMap boundaries are used first; gaps are filled from official BBS data (see source). A level is null only when neither source covers the point.
results[].sourcestringDataset of the place: OpenStreetMap (ODbL), GeoNames (CC BY 4.0) or Overture Maps Places (CDLA Permissive 2.0). osm is set only for osm.One of: osm, geonames, overture
results[].osmobjectSource OpenStreetMap object. Omitted for results without one (e.g. postcode areas).
admin_areasAdminAreasAdministrative areas containing a point, keyed by level, largest first. In Bangladesh: division, district, upazila, union. OpenStreetMap boundaries are used first; gaps are filled from official BBS data (see source). A level is null only when neither source covers the point.
summaryReverseSummaryDisplay-ready description of a reverse-geocoded point. Empty fields are omitted.
summary.labelrequiredstring
summary.nearrequiredbooleanThe closest match is within near_meters (default 150) of the point.
summary.distance_metersrequiredinteger | nullStraight-line meters from the point to the matched place; null when nothing matched.
summary.namestringPOI or building name of the match.
summary.house_numberstring
summary.roadstring
summary.neighbourhoodstring
summary.suburbstring
summary.citystring
summary.unionstring
summary.upazilastringUpazila or thana containing the point.
summary.districtstring
summary.divisionstring
summary.postcodestring
summary.countrystring
units_chargedrequiredinteger
regionrequiredstring

Response headers

  • X-Request-Id — Unique identifier for tracking and debugging this request.
  • X-RateLimit-Limit — Maximum permitted requests in current window.
  • X-RateLimit-Remaining — Remaining request quota in current window.
  • X-RateLimit-Reset — Seconds until the rate limit window resets.
  • X-Units-Charged — Billable request units consumed by this request.
  • X-Cache — Cache lookup status (`HIT` or `MISS`).
  • X-Region — Region code serving this routing request (e.g. `bd`).

Errors

StatusWhen
400Bad request (invalid coordinates, out of coverage, too many elements, etc.).
401Missing or invalid API key, or expired key.
402Free quota exhausted, no payment method, account suspended, or the monthly spend limit you set was reached. Never billed. Raise or remove the limit in the dashboard (Billing) and retry; nothing else changes.
403Account disabled, key IP restriction failed, origin not allowed, or scope not permitted.
429Rate limit exceeded or test key daily quota reached.
500Internal server error.
503Upstream routing service temporarily unavailable.

Error bodies contain a code such as OUT_OF_COVERAGE — see the error reference.

Try it

Interactive API Console

GET /v1/reverse-geocode

Sends a real request from your browser using a test key (free, never billed). The key stays in this browser tab only.

No key yet? Create a free test key.

Was this page helpful?