Hosted API: make a request
Addressr documents the request and response. RapidAPI handles your hosted account, API key, billing and plan changes.
- Start an Addressr plan on RapidAPI. Compare and select an Addressr plan on RapidAPI. RapidAPI is the authoritative source for current prices and request limits.
- Copy the API key from RapidAPI. Store it in the
RAPIDAPI_KEYenvironment variable; do not put it in browser code or commit it to source control. - Search for an address.
curl "https://addressr.p.rapidapi.com/addresses?q=300+Barangaroo+Ave" \ -H "x-rapidapi-key: $RAPIDAPI_KEY" \ -H "x-rapidapi-host: addressr.p.rapidapi.com" - Use the result. Each match includes a human-readable address in
slaand a stable address identifier inpid. Follow the response links or use the identifier with the address-detail endpoint for structured fields and geocoding.
Self-hosted: run the service
Choose this path when your team can operate Node.js, OpenSearch and quarterly G-NAF updates. Allow about an hour for the first full download and index; timing depends on your machine and options.
Addressr requires Node.js 22 or newer. Continuous integration tests the current release with OpenSearch 2.19.5 and 3.5.0.
- Install Addressr.
npm install --global @mountainpass/addressr - Start OpenSearch for local evaluation.
docker run --name addressr-opensearch \ -p 9200:9200 -p 9300:9300 \ -e "discovery.type=single-node" \ -e "plugins.security.disabled=true" \ opensearchproject/opensearch:3.5.0This example disables OpenSearch security and is for a local machine only. Do not expose it to a network or use it as a production security configuration.
- Start the API in a second terminal.
export ELASTIC_HOST=localhost export ELASTIC_PORT=9200 addressr-server-2 - Load G-NAF in a third terminal.
export ELASTIC_HOST=localhost export ELASTIC_PORT=9200 addressr-loaderThe loader downloads and indexes the Australian address data. Keep this terminal open until it completes.
- Check the local API.
curl "http://localhost:8080/addresses?q=300+Barangaroo+Ave"
For geocoding, state filters, cached data and scheduled updates, use the maintained self-hosting reference in the Addressr repository.