
Introduction
Search "OpenStreetMap API" and you'll find five different things hiding behind one phrase: a map display, geocoding, feature queries, routing, and navigation. OpenStreetMap (OSM) is a database. It doesn't ship as a single maps product.
That gap trips up many teams. They assume "free map data" means free, unlimited hosted services, and then hit rate limits in staging.
This guide covers which OSM services exist, which need keys, what's free, how to wire them into an app, and when a managed commercial service makes more sense.
Key Takeaways
- OSM is an open database; tiles, geocoding, routing, and rendering come from separate services.
- The official API reads small areas and handles edits. Nominatim and Overpass cover search and queries.
- Data is free under its license, but public endpoints enforce usage policies and carry no SLA.
- Pick OSM for control and customization; pick a managed provider for guarantees, traffic, and enterprise routing.
What Is the OpenStreetMap API?
OSM data versus the services around it
The OpenStreetMap Foundation describes OSM as an open initiative to create and provide free map data. Volunteers build and edit it.
Officially, "the API" means the data editing API. Developers use the phrase loosely for the whole ecosystem: Nominatim, Overpass, tile servers, and routing engines.
How OSM differs from a commercial platform
OSM doesn't bundle what commercial platforms do. You won't get these in one package:
- Hosted tiles
- Polished place search
- Live traffic
- Turn-by-turn navigation
- Street-level imagery
You choose compatible components, read each provider's terms, and design how data moves between them.
What you can build
OSM suits apps such as:
- Store locators and asset maps
- Delivery dashboards and fleet tracking
- Field-service apps and public maps
Fit depends on regional data quality, how fresh the data must be, request volume, traffic or imagery needs, and whether your team wants to run several services.
Which OpenStreetMap APIs and Services Do Developers Use?
Official OSM API
The v0.6 API supports create, read, update, and delete for nodes, ways, and relations, grouped into changesets. XML is standard, and documented read endpoints also support JSON.
Limits matter. A GET /api/0.6/map?bbox=... call is capped at roughly 0.25 square degrees and 50,000 nodes, and exceeding either returns HTTP 400. For bulk needs, use Planet files, extracts, or Overpass.
The API usage policy requires an identifying User-Agent and at most 2 download threads. Check current limits in the official docs before building.
Nominatim for geocoding
Forward geocoding turns an address into coordinates. Reverse geocoding turns coordinates into an address.
https://nominatim.openstreetmap.org/search?addressdetails=1&q=bakery+in+berlin+wedding&format=jsonv2&limit=1
The search response is a JSON array with place_id, osm_type, osm_id, lat, lon, display_name, and address. The /reverse?lat=...&lon=...&format=jsonv2 endpoint returns a single object instead.
Public service rules:
- Absolute maximum of 1 request per second
- Identifying User-Agent or Referer
- Cache results
- No client-side autocomplete
- Bulk geocoding discouraged; recurring scripts limited to 4 requests per minute
High-volume apps need a self-hosted instance or a separate provider. A planet install recommends 128GB+ RAM and 1TB+ disk.
Overpass for targeted queries
Overpass QL pulls tagged features, such as amenities, roads, or boundaries, from a chosen area.
/api/interpreter?data=[bbox];node[amenity=post_box];out;&bbox=7.0,50.6,7.3,50.8
Watch coordinate order. Inside QL, bbox is south,west,north,east. The URL parameter above uses longitude/latitude order. Add [out:json] for JSON.
Public instances share slots. Per Overpass documentation, expect 429 responses under load, with rough guidance of 10,000 requests and under 1GB per day. Use bounding boxes, tag filters, and moderate sizes. It isn't a bulk database.
Tiles and rendering libraries
Raw OSM data isn't a picture. Tile servers render it as raster images or vector features, and libraries like Leaflet or MapLibre display them.
The tile usage policy is blunt:
- Visible attribution required
- Identifying app User-Agent
- Honored cache headers (or at least 7 days of caching)
- Best-effort service with no SLA
- No offline downloading
Production traffic needs a commercial tile provider or self-hosted tiles.

Routing engines
The basic OSM API doesn't route. Separate engines do:
| Engine | Modes | Notes |
|---|---|---|
| OSRM | Car, bicycle, walk | Table service for matrices; static profiles; BSD-2-Clause |
| GraphHopper | Car, bike, foot, truck, bus, motorcycle | Hosted API needs a key; Apache-2.0 |
| Valhalla | Auto, bicycle, pedestrian, bus, truck, taxi, motorcycle | Height, weight, axle, hazmat options; MIT |
Verify turn-by-turn support, vehicle restrictions, traffic, matrix size, customization, offline support, and commercial terms. A capable engine is not a hosted guarantee. The FOSSGIS demo server, for example, allows 1 request per second and conditional commercial use only.
How to Integrate OpenStreetMap Into an Application
Define the workflow and boundaries
List what you need first:
- Visualization
- Search and geocoding
- Feature queries
- Routing, tracking, and analytics
Then split responsibilities:
- The client renders the map.
- Your server proxies provider requests and caches responses.
- Separate services handle search, feature queries, and routing.
Render a map with Leaflet
var map = L.map('map').setView([40.7128, -74.0060], 13);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
This is the official Leaflet pattern and works fine for a demo. Don't assume the public tile server can absorb production traffic.
Ask any tile provider about style control, vector versus raster, caching, uptime, and pricing. MapLibre follows the same idea with a raster source.
Add address search
Safe flow for user input:
- URL-encode the query.
- Call your own server endpoint, not Nominatim directly.
- Validate the response shape and handle empty arrays.
- Let users pick when results are ambiguous.
Server-side calls let you rate-limit, cache where permitted, protect privacy, and stop users from firing unlimited automated searches.

Query features
Filter by tag and bounding box, then convert the response to your internal format. If you repeatedly need the same data, switch to a scheduled extract.
Geofabrik regional extracts update daily, and Planet replication diffs run minutely, hourly, or daily. A self-hosted Overpass instance is the next step when query volume outgrows shared infrastructure.
Add routing and safeguards
A routing service returns geometry, distance, duration, maneuvers, and warnings you draw on the map. Plan for:
- Coordinate order (longitude/latitude versus latitude/longitude differs by tool)
- Travel profiles
- Invalid locations and snapping failures
- Timeouts, retries, and a fallback provider
Displaying one route is a different job from optimizing a multi-stop fleet plan. The second needs an optimization engine.
Production Considerations: Licensing, Limits, Data Quality, and Reliability
Licensing and attribution
OSM data uses the Open Database License (ODbL). Commercial use is allowed when you meet its conditions. It isn't "free with no strings."
- Show attribution: "© OpenStreetMap contributors," linked to the copyright page.
- A Produced Work (a rendered map) differs from a Derivative Database.
- Adapting or extending OSM data can trigger share-alike and database access duties.
- Get legal review before shipping a commercial product.
Public policies and rate limits
A missing API key does not mean unlimited access. Build safeguards at the application layer:
- Throttle request volume
- Deduplicate identical requests
- Cache responses where allowed
- Use exponential backoff
- Plan for 429s and outages
Coverage and data quality
Completeness varies by region. A 2025 Transactions in GIS study found metropolitan US counties outperform rural ones. US roads began with Census TIGER imports in 2007-2008, which left known accuracy problems.
Test your real operating areas. Validate addresses, road access, turn restrictions, vehicle attributes, private roads, and delivery points against operational data. Missing maxheight can mean unrestricted or simply unmapped.
Public, self-hosted, or managed
| Option | Trade-off |
|---|---|
| Public endpoints | Free, but shared and no SLA |
| Self-hosted | Full control, but you own imports, updates, storage, scaling, and monitoring |
| Managed provider | Support and SLAs, plus vendor terms |
Hardware is real. OSMF's raster render node uses 256GB+ RAM and 24+ cores.
Reliability, privacy, and cost
Treat production readiness as more than uptime:
- Keep third-party credentials server-side
- Minimize stored location data and limit coordinate logging
- Add observability and plan disaster recovery
- Count total cost across engineering, hosting, operations, support, geocoding, tiles, routing, and data maintenance, not only per-request fees
OpenStreetMap vs. Commercial Map APIs: How Should Developers Choose?
When OSM fits
OSM is strong when you value open data, deep map customization, data ownership, or the freedom to combine open-source components. It works well for prototypes, public-interest maps, and internal tools, provided your team can run or buy the surrounding infrastructure.
When a managed platform is better
Consider a managed platform when you need:
- Integrated geocoding and routing
- Real-time traffic
- Street-level imagery
- Guaranteed support and uptime
- Offline SDKs
- Less infrastructure to own
Test with real traffic patterns, coverage, latency, privacy, fallbacks, and total cost. Headline pricing misleads: Google's free thresholds, for example, are per SKU (10,000 free Dynamic Maps loads monthly), while Mapbox GL JS offers 50,000 free map loads. Units differ, so don't compare them directly.

Logistics and fleets: separate map data from optimization
A logistics company can use OSM for base maps while choosing a separate enterprise platform for truck restrictions, multi-stop planning, large matrices, and custom constraints. NextBillion.ai is one option to evaluate here. It isn't the official OSM API. Its Maps API uses OSM and TomTom data.
Capabilities the company lists include:
- Truck-aware routing and 50+ optimization constraints
- Per-vehicle or per-order pricing
- Cloud or on-premise deployment
- 5,000×5,000 sync matrix limit (per its documentation)
Its Kubernetes deployments have cut latency from roughly 200 ms to 50 ms in one customer case. These are vendor claims, so verify them in a trial.
Frequently Asked Questions
Is the OpenStreetMap API free?
The data is free under the ODbL. Public services still enforce rate limits and attribution, and production use may require paid or self-hosted infrastructure.
Are map APIs free to use?
Many offer free tiers. Tiles, geocoding, routing, traffic, and support often carry separate limits or charges at production scale.
Does OpenStreetMap need an API key?
Public Nominatim, Overpass, and OSM tiles have no provider key, but identification rules apply. Edits require OAuth 2.0, and third-party providers such as MapTiler usually require keys.
Does OpenStreetMap have an API?
Yes. The official v0.6 API reads and edits map data. Nominatim, Overpass, tile providers, and routing engines are separate services.
What is the OpenStreetMap API?
OSM is an open geographic database. Developers typically assemble a full mapping stack from several APIs and libraries.
Is there a Street View API?
No. OSM has no built-in Street View equivalent. Street-level imagery comes from separate providers, such as Mapillary, with their own coverage and licensing (Mapillary uses CC BY-SA).


