Miss any of our Open RFC calls?Watch the recordings here! »

postal-api

1.0.0 • Public • Published

NPM version Build Status Dependency Status Dev Dependency Status

postal-api

REST API server for libpostal

Install

$ npm install --global postal-api

Please note that postal-api is using postal-async and it expects that libpostal data is located in /var/lib/libpostal.

See libpostal docs on how to download the data.

API

parse

 curl 'http://localhost:4030/parse?address=781+Franklin+Ave+Crown+Hts+Brooklyn+NY'
[
  {
    "label": "house_number",
    "value": "781"
  },
  {
    "label": "road",
    "value": "franklin ave"
  },
  {
    "label": "suburb",
    "value": "crown hts"
  },
  {
    "label": "city_district",
    "value": "brooklyn"
  },
  {
    "label": "state",
    "value": "ny"
  }
]
 

expand

curl 'http://localhost:4030/expand?address=781+Franklin+Ave+Crown+Hts+Brooklyn+NY'
[
  "781 franklin avenue crown heights brooklyn ny",
  "781 franklin avenue crown heights brooklyn new york"
]

Environment

postal-api is using dotenv and by default reads its environment from /etc/default/postal-api

  • POSTAL_API_PORT - port number on which postal-api listens, defaults to 4030

License

MIT © Damian Krzeminski

Install

npm i postal-api

DownloadsWeekly Downloads

11

Version

1.0.0

License

MIT

Unpacked Size

4.97 kB

Total Files

5

Last publish

Collaborators

  • avatar