OSM GeoJSON API
Often, you just need some geospatial data for your app or website, such as building polygons for shadow calculations, street network paths for routing, cafes filtered by opening hours, or charging stations with fast food. Using public Overpass is a good start, but you quickly face rate limits and timeouts from just localhost dev.
There is a new API that solves this - the OSM GeoJSON API by MapLark. You simply query by bounding box, tags, and geometry shape and get GeoJSON back directly. No converting between formats manually. The API keeps OpenStreetMap semantics intact, like tags and ways, and returns GeoJSON Features you can feed straight into Leaflet, MapLibre, OpenLayers, or any geospatial toolchain. It is backed by postgis with tiered API keys and rate limiting to keep noisy neighbours out to give you predictable latency for real traffic. It also has self-host path for those willing to host complex infrastructure themselves.
The API query language is very simple:
- node - GeoJSON Point
- way - LineString or Polygon
- relation - MultiPolygon or grouped geometries
You filter with the same tags mappers already use (amenity=cafe, building=yes, and so on). Knowledge from OSM, Overpass, and tagging docs transfers immediately.
To narrow down between "open ways" and "closed ways", use the shape parameter:
- shape=line - open ways (roads, paths, rivers) or line-shaped relations (routes, boundaries)
- shape=polygon - closed ways (buildings, parks) or multipolygon relations.
- shape=all - both shapes (default).
For example, to get all buildings in an area: type=way & tags=building. This is the equivalent of the Overpass query way[building].
Read the full API reference here https://maplark.com/developer. You can also get started quickly with the Python osmgeojson lib.