Guides
Copy, paste, geocode.
Complete, runnable code for the geolith API at https://api.geolith.app: autocomplete in React and Vue, reverse geocoding, batch-geocoding a CSV, a MapLibre store locator, boundary polygons, and how a single-file geocoder works. Every example uses YOUR_API_KEY; a free key covers 100,000 requests a month.
12 min · react, autocomplete, javascriptHow to add address autocomplete to a React appA complete React component that suggests addresses as the user types, using the geolith autocomplete API with a browser-safe publishable key, debouncing, request cancelling and keyboard support.Read →12 min · vue, nuxt, autocompleteHow to add address autocomplete to a Vue or Nuxt appA Vue 3 composable and component for address autocomplete with the geolith API, plus the Nuxt runtime config to keep the publishable key out of your source.Read →18 min · geocoding, search, architectureHow to build a geocoder (and why a single static file works)How a geocoder turns text into coordinates, from tokenising and inverted indexes to ranking, autocomplete prefixes and spatial indexes, with a runnable toy geocoder in JavaScript and how geolith packs it all into one .glx file read with HTTP range requests.Read →8 min · javascript, node, reverse geocodingReverse geocoding in JavaScriptTurn latitude and longitude into an address in the browser and in Node.js with the geolith reverse geocoding API, including the user's current location and error handling.Read →12 min · maplibre, polygons, javascriptShow a place's boundary polygon on a mapSearch a place with geolith, fetch it by gid with geometry=true, and draw its outline on a MapLibre map, falling back to the bounding box when the place has no outline.Read →20 min · maplibre, store locator, javascriptBuild a store locator with MapLibre and geolithA complete store locator in one HTML file. Geocode your stores once with a script, then let shoppers search an address, see the nearest stores sorted by distance, and view them on a MapLibre map.Read →15 min · python, node, csvGeocode a CSV of addresses (Python and Node.js)Batch-geocode a spreadsheet of addresses with the geolith API in Python or Node.js, with a few parallel workers, retries on HTTP 429, and a quality column so you can review weak matches. Results may be stored permanently.Read →10 min · nominatim, openstreetmap, migrationAlternatives to the Nominatim public API for productionThe public Nominatim API allows at most 1 request per second and forbids autocomplete. Here are the production options (self-host Nominatim, Photon or Pelias, or use a hosted API) and the code to move a Nominatim call to geolith.Read →
Geocode your first address in a minute.
100,000 requests a month free. Commercial use with attribution. No card.