JSPM

postal-api

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q29414F
  • License MIT

REST API server for libpostal

Package Exports

  • postal-api
  • postal-api/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postal-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NPM version Build 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