postal-api
Version:
REST API server for libpostal
88 lines (62 loc) • 1.74 kB
Markdown
[![NPM version][npm-image]][npm-url]
[![Build Status][build-image]][build-url]
REST API server for libpostal
```sh
$ 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.
```sh
curl 'http://localhost:4030/parse?address=781+Franklin+Ave+Crown+Hts+Brooklyn+NY'
```
```json
[
{
"label": "house_number",
"value": "781"
},
{
"label": "road",
"value": "franklin ave"
},
{
"label": "suburb",
"value": "crown hts"
},
{
"label": "city_district",
"value": "brooklyn"
},
{
"label": "state",
"value": "ny"
}
]
```
```sh
curl 'http://localhost:4030/expand?address=781+Franklin+Ave+Crown+Hts+Brooklyn+NY'
```
```json
[
"781 franklin avenue crown heights brooklyn ny",
"781 franklin avenue crown heights brooklyn new york"
]
```
`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
MIT © [Damian Krzeminski](https://pirxpilot.me)
[]: https://www.npmjs.com/package/dotenv
[]: https://www.npmjs.com/package/postal-async
[]: https://github.com/openvenues/libpostal#data-files
[]: https://img.shields.io/npm/v/postal-api
[]: https://npmjs.org/package/postal-api
[]: https://github.com/pirxpilot/postal-api/actions/workflows/check.yaml
[]: https://img.shields.io/github/actions/workflow/status/pirxpilot/postal-api/check.yaml?branch=main