Feature
Place lookup and boundary outlines
The geolith place endpoint fetches up to 40 places by the gid that search returns: GET https://api.geolith.app/v1/place?ids=geolith:venue:… . With geometry=true it returns each place’s outline as a GeoJSON Polygon or MultiPolygon, with the point in properties.center and the outline’s bbox, for countries, regions, counties, localities and venues mapped as areas. Places with no outline in the data, such as cities without an OSM city boundary, come back as a Point.
What is a place outline?
A place outline is the boundary of an area, such as a country, a state, a district or a park, stored as a GeoJSON Polygon or MultiPolygon. geolith returns outlines from /v1/place with geometry=true, so an app can shade a region on a map or test whether a point lies inside it.
Detail
Look up by gid
Every result from search, autocomplete and reverse carries a gid such as geolith:locality:16174445. Store it with your record and fetch the place again later, in any language, with one call.
- ids: comma-separated gids, 1 to 40.
- geometry=true: return the outline when the place has one.
- lang: names in a given language.
# 1. Find the place and keep its gid
curl "https://api.geolith.app/v1/search?text=france&layers=country&size=1" \
-H "Authorization: Bearer YOUR_API_KEY"
# 2. Fetch it by gid, asking for its outline (France: a MultiPolygon)
curl "https://api.geolith.app/v1/place?ids=geolith:country:1363947712&geometry=true" \
-H "Authorization: Bearer YOUR_API_KEY"Detail
Draw the boundary
An outline is plain GeoJSON, so MapLibre, Leaflet, OpenLayers and deck.gl draw it with no conversion. Fit the map to the bbox and add the polygon as a fill layer.
Detail
When there is no outline
Some places exist in the data only as a point, for example a city mapped as a single node or a small shop. Those return a Point, often with a bbox. Check geometry.type and fall back to the point or the bbox; the boundary guide shows how.
Guides
See it in code
Questions
Place outlines: questions
- Which places have outlines?
- Countries, regions, counties, localities and venues that are mapped as areas in OpenStreetMap or Overture. Points such as a single shop have no outline and come back as a Point.
- Does the hosted API return polygons?
- Yes. GET https://api.geolith.app/v1/place?ids=<gid>&geometry=true returns a Polygon or MultiPolygon for places that have an outline, such as France (country), Maharashtra (region) or Cubbon Park (venue). Cities without an OSM city boundary return a Point.
- How many places can I fetch at once?
- Up to 40 gids per request, comma-separated in ids.
Sources
- RFC 7946: The GeoJSON Format, IETF (read 2026-10-22)
Geocode your first address in a minute.
100,000 requests a month free. Commercial use with attribution. No card.