A simple API wrapper for the Loqate (Postcode Anywhere / PCA Predict) Service
Authors:
An unofficial implementation of the Loqate API for modern Javascript to easily lookup addresses from Post Codes or Partial Address details.
A Loqate account and API key is required to use this package.
Add the package to your project
npm install @thesold/pcapredict
import { Lookup } from '@thesold/pcapredict'
const lookup = new Lookup('API-KEY')
lookup.find('POST CODE').get()
.then((results) =>
// results contains an array of addresses found
lookup.retrieve(results[0]).then((address) => {
// address contains the full address details for the requested entry
})
)
.catch((error) => {
// Something went wrong
})
Please see the official API documentation for details about the data returned.