Skip to content

Solution

A store locator that costs a few requests, not a few dollars

A store locator needs three things from a geocoder: coordinates for each store, an address box for the shopper, and a way to turn a phone’s location into a place name. geolith does all three with one API key: geocode your stores once and store the results permanently (allowed on every plan), use /v1/autocomplete for the search box, and /v1/reverse for "use my location". The Free plan includes 100,000 requests a month.

What is a store locator?

A store locator is a page that finds the shops or branches nearest to a customer: the customer types an address or shares a location, and the page lists stores sorted by distance and shows them on a map. It needs geocoding for the store addresses, autocomplete for the search box and reverse geocoding for “use my location”.

Detail

The request budget

Geocode each store once and save the coordinates in your database. Shoppers then cost one autocomplete call per pause in typing, plus one call when they pick a result. Distance sorting happens in your code with the haversine formula; it needs no API call.

  • Stores: one /v1/search per store, once, stored permanently.
  • Shopper search: /v1/autocomplete while typing, with boundary.country set.
  • "Use my location": one /v1/reverse to show the shopper where they are.
  • Map: MapLibre GL JS with any basemap.

Detail

Everything in one guide

The store locator guide builds the whole page with MapLibre and geolith: a search box, a list sorted by distance and markers on a map, in one HTML file.

Guides

See it in code

Questions

Store locator: questions

Can I save store coordinates from geolith in my database?
Yes. Results may be stored permanently on every plan, including Free. Show the OpenStreetMap and Overture attribution on the map or page.
How many requests does a store locator use?
One per store, once, plus about one or two autocomplete calls per shopper search when you debounce typing. A locator with 200 stores and 30,000 searches a month fits in the Free plan’s 100,000 requests.

Geocode your first address in a minute.

100,000 requests a month free. Commercial use with attribution. No card.