Feature
Autocomplete that finishes the word for the user
The geolith autocomplete API returns ranked suggestions for partial text: GET https://api.geolith.app/v1/autocomplete?text=band returns places and addresses that start with what the user has typed so far. In the India benchmark (20 Oct 2026) the first suggestion was the right place for 82.5% of queries, against 42.5% for Photon and 32.5% for Pelias; Nominatim has no autocomplete endpoint. Use a publishable key in the browser, locked to your site’s origins.
What is address autocomplete?
Address autocomplete suggests complete places and addresses while a user is still typing, so the user picks a correct, already geocoded result instead of typing the whole address. geolith autocomplete treats the last word as a prefix, so “times squ” already returns Times Square, and every suggestion carries its coordinates.
Detail
Built for keystrokes
Autocomplete treats the last word as a prefix, so "bandra ku" can already match Bandra Kurla Complex. It accepts the same filters as search, so a checkout form can keep suggestions inside one country and near the shopper.
- Same response shape as /v1/search: a GeoJSON FeatureCollection.
- Filter with boundary.country, layers and categories.
- Bias with focus.point.lat and focus.point.lon, for example the user’s city.
- Each request counts once against your monthly quota, like any other request.
async function suggest(text, signal) {
const url = new URL('https://api.geolith.app/v1/autocomplete');
url.searchParams.set('text', text);
url.searchParams.set('size', '5');
url.searchParams.set('api_key', 'YOUR_PUBLISHABLE_KEY'); // gc_pk_...
const res = await fetch(url, { signal });
if (!res.ok) return [];
const { features } = await res.json();
return features.map((f) => ({
id: f.properties.gid,
label: f.properties.label,
lon: f.geometry.coordinates[0],
lat: f.geometry.coordinates[1],
}));
}Detail
Safe to call from the browser
Publishable keys (gc_pk_…) only answer requests whose Origin is on the key’s allowed list, so a copied key does not work from someone else’s site. Keep secret keys (gc_sk_…) on your server.
Detail
Good habits for a search box
Wait about 150 to 250 ms after the last keystroke before calling, cancel the previous request with an AbortController, and only start after two or three characters. That keeps the box fast and your request count low.
Guides
See it in code
Questions
Autocomplete: questions
- Is autocomplete billed differently from search?
- No. Every API request counts once against your plan’s monthly quota, whichever endpoint it calls. There are no session prices.
- Can I use autocomplete directly from a React or Vue app?
- Yes. Create a publishable key in the dashboard, add your site’s origin to its allowed origins, and call /v1/autocomplete with ?api_key=. The guides show complete React and Vue components.
- What happens when I run out of requests?
- Requests stop with HTTP 429 and the code quota_exceeded until the month ends or you upgrade. There is no surprise overage bill.
Sources
- geolith search benchmarks: engines, geolith (read 2026-10-22)
Geocode your first address in a minute.
100,000 requests a month free. Commercial use with attribution. No card.