Skip to content
Go (cgo) interface to libpostal for fast international address parsing/normalization
Branch: master
Clone or download
albarrentine Merge pull request #10 from oschwald/greg/free-expansion-array
Free expansion array after creating Go strings
Latest commit e018451 Dec 26, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
parser [concurrency] adding a mutex around parser CGo calls Sep 18, 2017
.gitignore Initial commit Feb 16, 2016
LICENSE Initial commit Feb 16, 2016 [api][docs][build] updating Go/cgo binding to use libpostal 1.0 Apr 3, 2017


Build Status

Go/cgo interface to libpostal, a C library for fast international street address parsing and normalization.


To expand address strings into normalized forms suitable for geocoder queries:

package main

import (
    expand ""

func main() {
    expansions := expand.ExpandAddress("Quatre-vingt-douze Ave des Ave des Champs-Élysées")

    for i := 0; i < len(expansions); i++ {

To parse addresses into components:

package main

import (
    parser ""

func main() {
    parsed := parser.ParseAddress("781 Franklin Ave Crown Heights Brooklyn NY 11216 USA")


Before using the Go bindings, you must install the libpostal C library. Make sure you have the following prerequisites:

On Ubuntu/Debian

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


sudo yum install curl autoconf automake libtool pkgconfig

On Mac OSX

sudo brew install curl autoconf automake libtool pkg-config

Installing libpostal

git clone
cd libpostal
./configure --datadir=[...some dir with a few GB of space...]
sudo make install

# On Linux it's probably a good idea to run
sudo ldconfig


For expansions:

go get

For parsing:

go get


go test
You can’t perform that action at this time.