Skip to content

egorsmkv/api-libpostal

Repository files navigation

API for libpostal

What is this?

It is a simple API for the library libpostal that parses raw adresses.

Example

Install (for Ubuntu)

Install libpostal:

sudo apt-get install curl autoconf automake libtool pkg-config

git clone https://github.com/openvenues/libpostal
cd libpostal
./bootstrap.sh
./configure --datadir=[...some dir with a few GB of space...]
make -j4
sudo make install
sudo ldconfig

Install API libpostal:

git clone https://github.com/egorsmkv/api-libpostal.git
cd api-libpostal
cmake .
make

Running

./api_libpostal

After running you can access this URL: http://127.0.0.1:8080/demo

CURL usage

curl -vvvv -H "X-To-Parse: Quatre vingt douze R. de l'Église	" http://127.0.0.1:8080/parse

curl -H "X-To-Parse: 04073, м.Київ, Оболонський район, ВУЛИЦЯ КИРИЛІВСЬКА, будинок 160, корпус Б" http://127.0.0.1:8080/parse

Note: you need to encode the "X-To-Parse" parameter using urlencode.

About

API for libpostal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published