Geocoding
🌐 API endpoint
https://api.exoapi.dev/geocoding
📃 Description
Effortlessly convert human-readable addresses into GPS coordinates
️ Request example
// npm install @flower-digital/exoapi-sdk
import { ExoAPI } from "@flower-digital/exoapi-sdk";

const exoapi = new ExoAPI({ apiKey: YOUR_API_KEY });

async function geocoding() {
  try {
    const res = await exoapi.geocoding({
      address: "221B Baker Street, London, United Kingdom",
      locale: "en-GB",
    });
    console.log(res);
  } catch (err) {
    console.error(err);
  }
}

geocoding();
️ Request parameters
NameTypeExampleDescription
address
required
string
221B Baker Street, London, United Kingdom
Address to geocode (free text)
locale
string
en
en-US
fr-FR
pt-BR
BCP 47 language/country code
️ Response example
{
  "address": "221B Baker Street, London NW1 6XE, United Kingdom",
  "lat": 51.5237498111111,
  "lon": -0.1585443,
  "houseNumber": "221B",
  "street": "Baker Street",
  "postalCode": "NW1 6XE",
  "city": "London",
  "region": "England",
  "regionCode": "GB-ENG",
  "country": "United Kingdom",
  "countryCode": "GB",
  "countryCode3": "GBR",
  "currency": "GBP"
}
️ Response data
NameTypeExampleDescription
address
string
221B Baker Street, London NW1 6XE, United Kingdom
Formatted address of the closest match, according to locale parameter
lat
number
51.5237498111111
Latitude
lon
number
-0.1585443
Longitude
houseNumber
string
221B
House number
street
string
Baker Street
Street name
postalCode
string
NW1 6XE
Postal code
city
string
London
City name
region
string
England
Region/state name
regionCode
string
GB-ENG
ISO3166-2 region/state code
country
string
United Kingdom
Country name
countryCode
string
GB
ISO 3166-1 alpha-2 country code
countryCode3
string
GBR
ISO3166-1 alpha3 country code
currency
string
GBP
ISO 4217 currency code, if available