https://api.exoapi.dev/reverse-geocoding// npm install @flower-digital/exoapi-sdk
import { ExoAPI } from "@flower-digital/exoapi-sdk";
const exoapi = new ExoAPI({ apiKey: YOUR_API_KEY });
async function reverseGeocoding() {
try {
const res = await exoapi.reverseGeocoding({
lat: 51.5237498111111,
lon: -0.1585443,
locale: "en-GB",
});
console.log(res);
} catch (err) {
console.error(err);
}
}
reverseGeocoding();{
"lat": 51.5237498111111,
"lon": -0.1585443,
"address": "221B Baker Street, London NW1 6XE, United Kingdom",
"houseNumber": "221B",
"street": "Baker Street",
"postalCode": "NW1 6XE",
"city": "London",
"region": "England",
"regionCode": "GB-ENG",
"country": "United Kingdom",
"countryCode": "GB",
"countryCode3": "GBR",
"currency": "GBP"
}