Point a Nominatim, Photon or libpostal client at Mailwoman
Use this procedure when an application already calls Nominatim, Photon or a libpostallibpostalAn open-source C address parser used by Pelias. Mailwoman's rule-based v0 and neural classifier supersede it. REST service, and you want it to call Mailwoman with as few changes as possible. Each compatibility package runs its own server with that service's routes. Change the client's base URL, then compare the fields your client reads with the responses on this page.
Prerequisites
- Node.js
^24.22.3 || >=26.13.1.
Install the compatibility package for your client next to the parser packages:
- npm
- Yarn
- pnpm
- Bun
npm install mailwoman @mailwoman/nominatim @mailwoman/photon @mailwoman/libpostal
yarn add mailwoman @mailwoman/nominatim @mailwoman/photon @mailwoman/libpostal
pnpm add mailwoman @mailwoman/nominatim @mailwoman/photon @mailwoman/libpostal
bun add mailwoman @mailwoman/nominatim @mailwoman/photon @mailwoman/libpostal
The Nominatim and Photon servers geocode, so they need the global place candidates, plus address pointssitus dataA dataset of exact address-point coordinates (rooftop-level). Mailwoman's geocoder uses a national situs layer (124.9M US points built from state address-point sources) as the highest-precision tier of the geocode cascade. for the places your client queries. The examples query Washington, DC:
export MAILWOMAN_DATA_ROOT="$HOME/mailwoman-data"
npx mailwoman data pull candidate
npx mailwoman data pull us --only us-dc
The libpostallibpostalAn open-source C address parser used by Pelias. Mailwoman's rule-based v0 and neural classifier supersede it. server parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. text and reads no geographic data. The responses below were captured with local builds of these bundlesevidence bundleThe pair of retrieval-augmented input channels (street-type + locality-surface) that feed lexicon membership as soft per-token evidence alongside the text. Shipped in 6.7.0; trained natively from step 0 in the from-scratch base line. that are newer than the 11.0.0 registry entries.
Nominatim clients
Start the server on the port your client will call:
npx nominatim serve --port 7803 --host 127.0.0.1 --candidate-db "$MAILWOMAN_DATA_ROOT/db/wof/candidate.db"
It prints the routes it serves: GET /search, GET /reverse, GET /lookup, GET /status and GET /openapi.json. Point the client's base URL at http://127.0.0.1:7803.
A free-text search with format=jsonv2 and addressdetails=1:
curl --get http://127.0.0.1:7803/search --data-urlencode "q=1600 Pennsylvania Ave NW, Washington, DC 20500" --data-urlencode "format=jsonv2" --data-urlencode "addressdetails=1"
[
{
"place_id": 2734451821,
"licence": "Data © Who's On First, Overture Maps, OpenAddresses, US Census TIGER",
"lat": "38.89767510742324",
"lon": "-77.03654697024702",
"display_name": "1600, Pennsylvania Ave NW, Washington, DC, 20500",
"mailwoman": { "coordinate_source": { "source": "overture:NAD", "release": "2026-05-20.0" } },
"class": "place",
"type": "house",
"address": {
"city": "Washington",
"state": "DC",
"postcode": "20500",
"house_number": "1600",
"road": "Pennsylvania Ave NW"
},
"annotations": {
"DMS": { "lat": "38° 53′ 51.63″ N", "lng": "77° 2′ 11.57″ W" },
"MGRS": "18SUJ2339007392",
"Maidenhead": "FM18lv",
"Mercator": { "x": -8575669.1812, "y": 4707024.990299999 },
"geohash": "dqcjqcpeq",
"qibla": 56.56149203398303,
"sun": { "rise": { "apparent": 1794311189 }, "set": { "apparent": 1794348021 } }
},
"engine": {
"name": "mailwoman",
"version": "11.0.0",
"license": "AGPL-3.0-only",
"license_url": "https://mailwoman.post/license",
"notice": "mailwoman is licensed AGPL-3.0-only: modified or network-served copies must offer their source. A commercial license waives that obligation."
}
}
]
Check these differences against your client:
- The result has
place_id,licence,lat,lon(as strings),display_name,class,typeandaddress. It has noosm_type,osm_id,boundingbox,importanceorplace_rank. Thejsonv2format still returnsclassrather thancategory. address.stateholds the abbreviation from the input,DC.- The
mailwoman.coordinate_sourcefield identifies the register behind the coordinate.annotationsandengineare Mailwoman additions.
A structured search with city and state returned the Springfield, Illinois citylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighborhood in the hierarchy. point. Its result has no class, type or address fields:
curl --get http://127.0.0.1:7803/search --data-urlencode "city=Springfield" --data-urlencode "state=IL" --data-urlencode "format=json"
[
{
"place_id": 1523220856,
"licence": "Data © Who's On First, Overture Maps, OpenAddresses, US Census TIGER",
"lat": "39.797328",
"lon": "-89.645547",
"display_name": "Springfield, IL",
"annotations": {
"DMS": { "lat": "39° 47′ 50.38″ N", "lng": "89° 38′ 43.97″ W" },
"MGRS": "16SBK7349508611",
"Maidenhead": "EM59et",
"Mercator": { "x": -9979296.643924473, "y": 4836534.097786217 },
"geohash": "dp062hfh5",
"qibla": 47.460111271008884,
"sun": { "rise": { "apparent": 1794314329 }, "set": { "apparent": 1794350934 } },
"timezone": { "name": "America/Chicago", "offset_sec": -21600 },
"UN_LOCODE": "US RN7"
},
"engine": {
"name": "mailwoman",
"version": "11.0.0",
"license": "AGPL-3.0-only",
"license_url": "https://mailwoman.post/license",
"notice": "mailwoman is licensed AGPL-3.0-only: modified or network-served copies must offer their source. A commercial license waives that obligation."
}
}
]
That capture came from a data root with additional local databases. Those databases add timezone and UN_LOCODE to annotations. Your annotations can omit them.
/lookup isn't implemented and returns status 501:
curl -i "http://127.0.0.1:7803/lookup?osm_ids=W5013364"
HTTP/1.1 501 Not Implemented
content-type: application/json
{"error":"this engine does not implement lookup"}
Only the status line, content type and body of that response are shown. /reverse needs a Who's On FirstWOF (Who's On First). An open-source gazetteer of places maintained by Mapzen/whosonfirst. Mailwoman builds a custom SQLite database from WOF GeoJSON repos, extended with postcode data, importance scores, and coincident-role relations. admin gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture.. You build that gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture. separately from the data bundlesevidence bundleThe pair of retrieval-augmented input channels (street-type + locality-surface) that feed lexicon membership as soft per-token evidence alongside the text. Shipped in 6.7.0; trained natively from step 0 in the from-scratch base line.. Reverse-geocode a coordinate describes how to build one. Without it, /reverse returns status 200 with the body null:
curl "http://127.0.0.1:7803/reverse?lat=38.8977&lon=-77.0365&format=jsonv2"
null
The compatible servers look for the admin gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture. among the data root's Who's On FirstWOF (Who's On First). An open-source gazetteer of places maintained by Mapzen/whosonfirst. Mailwoman builds a custom SQLite database from WOF GeoJSON repos, extended with postcode data, importance scores, and coincident-role relations. databases, where its conventional path is db/wof/admin-global-priority.db. They don't read MAILWOMAN_WOF_ADMIN_DB, the variable the mailwoman reverse command reads. With an admin gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture. in the data root, the same request returned "display_name":"White House Grounds, Northwest Washington, Washington, District of Columbia, District of Columbia, United States" and no address object. /status?format=json returns "status":0,"message":"OK" with a mailwoman.artifacts list that identifies each database the server opened.
Photon clients
Start the server and point the client at it:
npx photon serve --port 7804 --host 127.0.0.1 --candidate-db "$MAILWOMAN_DATA_ROOT/db/wof/candidate.db"
It serves GET /api, GET /reverse and GET /openapi.json. A search:
curl --get http://127.0.0.1:7804/api --data-urlencode "q=1600 Pennsylvania Ave NW, Washington, DC 20500" --data-urlencode "limit=1"
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-77.03654697024702, 38.89767510742324] },
"properties": {
"osm_key": "place",
"osm_value": "house",
"type": "house",
"city": "Washington",
"state": "District of Columbia",
"postcode": "20500",
"country": "United States",
"countrycode": "us",
"housenumber": "1600",
"street": "Pennsylvania Ave NW",
"mailwoman": { "coordinate_source": { "source": "overture:NAD", "release": "2026-05-20.0" } }
}
}
],
"engine": {
"name": "mailwoman",
"version": "11.0.0",
"license": "AGPL-3.0-only",
"license_url": "https://mailwoman.post/license",
"notice": "mailwoman is licensed AGPL-3.0-only: modified or network-served copies must offer their source. A commercial license waives that obligation."
}
}
Check these differences against your client:
- FeaturefeatureAn input signal a model conditions on. Beyond the raw tokens, Mailwoman feeds soft features — gazetteer-membership channels and the postcode anchor — that inform predictions without overriding them.
propertieshaveosm_key,osm_value,type, the address fields,countryandcountrycode. They have noosm_id,osm_typeorextent. A house result has noname. stateholds the full name,District of Columbia, unlike the Nominatim server'sDC.limitis honored. A search forSpringfieldwithlimit=3returned three US cities called Springfield.
Without an admin gazetteergazetteerA geographical index that maps place names and postcodes to real-world coordinates. Mailwoman uses a custom-built Who's On First (WOF) SQLite database as its gazetteer — the 'atlas' half of the grammar/atlas architecture., /reverse returns an empty featurefeatureAn input signal a model conditions on. Beyond the raw tokens, Mailwoman feeds soft features — gazetteer-membership channels and the postcode anchor — that inform predictions without overriding them. collection with status 200:
{
"type": "FeatureCollection",
"features": [],
"engine": {
"name": "mailwoman",
"version": "11.0.0",
"license": "AGPL-3.0-only",
"license_url": "https://mailwoman.post/license",
"notice": "mailwoman is licensed AGPL-3.0-only: modified or network-served copies must offer their source. A commercial license waives that obligation."
}
}
libpostal clients
The libpostallibpostalAn open-source C address parser used by Pelias. Mailwoman's rule-based v0 and neural classifier supersede it. server parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. and expands text without geographic data:
npx libpostal serve --port 7805 --host 127.0.0.1
It serves GET and POST on /parse and /expand, and GET /openapi.json. A parseaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates.:
curl -X POST http://127.0.0.1:7805/parse -H "content-type: application/json" -d '{"query":"781 Franklin Ave Crown Heights Brooklyn NYC NY 11216 USA"}'
[
{ "label": "house_number", "value": "781" },
{ "label": "road", "value": "Franklin Ave" },
{ "label": "city", "value": "Crown Heights Brooklyn NYC" },
{ "label": "state", "value": "NY" },
{ "label": "postcode", "value": "11216" },
{ "label": "country", "value": "USA" }
]
The response is the ordered label and value array that libpostallibpostalAn open-source C address parser used by Pelias. Mailwoman's rule-based v0 and neural classifier supersede it. REST services return. Values keep the input's casing. The three place namestoponymA proper name for a geographic place. before the state came back as one city value, Crown Heights Brooklyn NYC. Check whether your client expects a neighborhood or district as a separate labelcomponent tagOne of the 25 labels in Mailwoman's address schema — street, locality, region, postcode, house_number, unit, po_box, country, venue, intersection, and others. Each parsed span carries exactly one component tag..
An expansion:
curl -X POST http://127.0.0.1:7805/expand -H "content-type: application/json" -d '{"address":"781 Franklin Ave Brooklyn NY"}'
{ "expansions": ["781 Franklin Ave Brooklyn NY", "781 Franklin Avenue Brooklyn NY"] }
Check your client before switching
- Send the requests your client makes in production to both the current service and the Mailwoman server.
- List the response fields your client reads, and confirm each one is present in the Mailwoman response.
- Handle the empty results described above:
nullfrom Nominatim/reverse, an empty featurefeatureAn input signal a model conditions on. Beyond the raw tokens, Mailwoman feeds soft features — gazetteer-membership channels and the postcode anchor — that inform predictions without overriding them. collection from Photon/reverse, and status 501 from Nominatim/lookup.
Each server also serves GET /openapi.json, its machine-readable route description. The HTTP reference lists every compatibility route and its declared status codes.