Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pirxpilot/postal-api
REST API server for libpostal
https://github.com/pirxpilot/postal-api
Last synced: 13 days ago
JSON representation
REST API server for libpostal
- Host: GitHub
- URL: https://github.com/pirxpilot/postal-api
- Owner: pirxpilot
- Created: 2019-07-27T00:02:25.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-05T06:56:59.000Z (9 months ago)
- Last Synced: 2024-11-23T19:13:20.396Z (20 days ago)
- Language: Shell
- Size: 14.6 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
[![NPM version][npm-image]][npm-url]
[![Build Status][build-image]][build-url]# postal-api
REST API server for libpostal
## Install
```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.
## API
### `parse`
```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"
}
]```
### `expand`
```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"
]
```## 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](https://pirxpilot.me)
[dotenv]: https://www.npmjs.com/package/dotenv
[postal-async]: https://www.npmjs.com/package/postal-async
[libpostal docs]: https://github.com/openvenues/libpostal#data-files[npm-image]: https://img.shields.io/npm/v/postal-api
[npm-url]: https://npmjs.org/package/postal-api[build-url]: https://github.com/pirxpilot/postal-api/actions/workflows/check.yaml
[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/postal-api/check.yaml?branch=main