A free geocoding API you run yourself
The free tier of a hosted geocoding API ends at a daily or monthly cap, and most need a key. This one has neither, because it runs on your machine: one program, one file per country (places come in a separate, optional file), and an HTTP API on localhost.
Two commands
$ gridpin-fetch us # United States, 1.45 GB, checked; prints the path $ gridpin serve "$(gridpin-fetch us)" --port 8080 listening on http://127.0.0.1:8080 ready: sheet read and fallback tables built in 3.6 s
No account and no key. gridpin-fetch downloads the country file once and checks it against the signed release; after that the server makes no network requests. How to install both programs: install.
Forward, reverse and batch
$ curl "http://127.0.0.1:8080/v1/geocode?q=1600+Pennsylvania+Ave+NW,+Washington,+DC+20500"
{"results":[{"commune":"Washington","confidence":0.949999988079071,"flags":["street_exact","commune_exact","house_rep","pc_exact"],"housenumber":"1600","lat":38.8976751,"lon":-77.036547,"match_level":"PointAddress","match_status":"M","postcode":"20500","precision":"house","score":7.2687788009643555,"street":"PENNSYLVANIA Avenue Northwest","weak":false}]}
$ curl -X POST http://127.0.0.1:8080/v1/geocode -H "Content-Type: application/json" \
-d '{"queries": ["233 S Wacker Dr, Chicago, IL 60606", "Nowhere Street 99999, Atlantis"]}'
{"results":[[{"commune":"Chicago","confidence":0.949999988079071,"flags":["street_exact","commune_exact","house_rep","pc_exact"],"housenumber":"233","lat":41.878658,"lon":-87.6358684,"match_level":"PointAddress","match_status":"M","postcode":"60606","precision":"house","score":7.2687788009643555,"street":"South WACKER Drive","weak":false}],[]]}
One address is a GET; a list of up to 10,000 goes in one POST. When nothing fits, the answer is an empty list, not a guess, and every answer says how exact it is in precision. Coordinates to an address: reverse geocoding.
Clients you already have
| Your client speaks | Path on the local server | Guide |
|---|---|---|
| Nominatim (geopy, Leaflet and MapLibre search boxes, Traccar) | /search, /reverse | local server |
| Google Geocoding API | /maps/api/geocode/json | moving off Google |
| Mapbox Geocoding v5 | /geocoding/v5/… | Mapbox on your server |
| Photon | /photon/api | Photon paths |
| Pelias | /pelias/v1/search | server paths |
Point an existing client at the local address and keep its code. GridPin is not affiliated with these projects and services; their formats are followed so that existing code keeps working.
What free means here
- The engine is open source under Apache-2.0.
- The country files of each release are free to download, with no account. They are static builds: complete, with no time limit and no update schedule.
- There is no per-request fee on any plan and no cap. The limit is your hardware.
- Paid plans add files rebuilt every month and a commercial licence for products and services you sell: pricing, Free, Starter and Pro.
When a hosted free tier fits better
- You need the whole world. GridPin covers these countries and answers nothing outside them.
- You cannot run a process. There is no hosted GridPin endpoint.
- You search for shops and landmarks by name. GridPin answers addresses first; the places layer is optional and best-effort.
What the hosted services charge once their free tier ends: geocoding API pricing.