Addressing

Note An API key is required to access the location APIs. If you need one, check our authentication page

Using the location API you can convert geographic coordinates to their unique word unl address.

All addresses for a given cellId can be accessed via our location API. This is an authenticated endpoint, which converts any geoId into it's respective locationId, words, coordinates, claimed address, etc...

const unl = require('unl-core')
const axios = require('axios')
let coordinates = [52.372607,4.900363]
// 'u173zw0kd'
const cellId = unl.encode(coordinates)
// add your API key via 'apikey' header
const res = await axios.get(`https://api.unl.global/v1/location/words/${cellId}`, {
headers: {
'apikey': 'myunlapikey'
}
});
// 'NL9.caving.airfare'
console.log(res.words)

Axios: https://www.npmjs.com/package/axios