GET /v1/reverse-geocode
Reverse Geocoding API: coordinates to addresses
Request and response
curl "https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376" \
-H "Authorization: Bearer $WAYLINE_API_KEY"const res = await fetch(
"https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376",
{ headers: { Authorization: `Bearer ${process.env.WAYLINE_API_KEY}` } },
);
if (!res.ok) throw new Error(`Wayline ${res.status}: ${await res.text()}`);
const data = await res.json();
console.log(data);import os, requests
res = requests.get(
"https://api.wayline.cloud/v1/reverse-geocode",
params={"point": "23.7465,90.376"},
headers={"Authorization": f"Bearer {os.environ['WAYLINE_API_KEY']}"},
timeout=10,
)
res.raise_for_status()
print(res.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("WAYLINE_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(body))
}<?php
$ch = curl_init("https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("WAYLINE_API_KEY")],
CURLOPT_TIMEOUT => 10,
]);
$data = json_decode(curl_exec($ch), true);
print_r($data);require "net/http"
require "json"
uri = URI("https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("WAYLINE_API_KEY")}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
puts JSON.parse(res.body)import java.net.URI;
import java.net.http.*;
public class Main {
public static void main(String[] args) throws Exception {
var req = HttpRequest.newBuilder(URI.create("https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376"))
.header("Authorization", "Bearer " + System.getenv("WAYLINE_API_KEY"))
.GET().build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.statusCode() + " " + res.body());
}
}import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
Future<void> main() async {
final res = await http.get(
Uri.parse('https://api.wayline.cloud/v1/reverse-geocode?point=23.7465,90.376'),
headers: {'Authorization': 'Bearer ${Platform.environment['WAYLINE_API_KEY']}'},
);
print(jsonDecode(res.body));
}{
"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"
}What the Reverse Geocoding API gives you
Address plus admin areas
Each response includes the closest place and the areas containing the point; in Bangladesh that is division, district, upazila and union.
Batch up to 100 points
POST /v1/reverse-geocode/batch labels a rep's whole day of check-ins in one call. Out-of-coverage points are flagged and not billed.
Works in rural areas
When nothing is mapped within about 1 km, the search widens to 5 km once, and village data from GeoNames and Overture fills OpenStreetMap gaps.
Filter what you get back
Use types=street,locality to skip shops and points of interest, radius_meters to cap distance, and lang=bn for local names.
How reverse geocoding works
The point is matched to the region that contains it, then searched against that region's place index, closest first. The response tells you how far the returned place is from your point, so you can decide when a label is precise enough to show.
Pair it with distance and mileage
Field teams typically reverse geocode each check-in, then use the Batch Distance API for road mileage between consecutive check-ins. Both run on the same OpenStreetMap-based data and the same API key.
Frequently asked questions
How accurate is the returned address?
It is the closest mapped address or place to your coordinate, and distance_meters tells you how far away it is. In dense cities that is usually a few meters; in rural areas it may be a village or union rather than a street.
How is batch reverse geocoding billed?
One reverse_geocode unit per point inside coverage. Points outside coverage come back with status OUT_OF_COVERAGE and are not billed.
Can I store the results?
Yes. Results come from open data, so you can store them with your records. Keep the OpenStreetMap attribution where you display map-derived data.
Start building in minutes
Create an account, grab a test key and make your first request in under five minutes.