OpenStreetMap API

Geocoding / OAuth Advanced HTTP
74 B
Measured Score 0 50 100 Speed 16/30 Consistency 20/20 Security 20/20 Browser access 10/15 Transparency 8/15 TESTED 2026-08-10

Overview

OpenStreetMap is a free, community-built map of the world that lets you read and contribute geographic data. You can use its API to fetch map tiles, search for places, and retrieve raw map data using OAuth authentication. It is a great open-source alternative to paid mapping services.

Beginner Tip

Start by exploring the read-only endpoints which do not require authentication—you only need OAuth when writing or editing map data. Rate limits apply, so cache responses whenever possible.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.openstreetmap.org/api/0.6/node/1
Result
HTTP 200 · application/json · 716 bytes · compressed
Response time
244 ms (median of 3) · fastest 237 ms
Transport
TLSv1.3 · TLS_AES_128_GCM_SHA256 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: https://apisscore.com
Served by
Apache
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
version string 0.6
generator string openstreetmap-cgimap 2.1.0 (3558378 spike-08.…
copyright string OpenStreetMap and contributors
attribution string (url) http://www.openstreetmap.org/copyright
license string (url) http://opendatacommons.org/licenses/odbl/1-0/
elements array [1 item]

Captured Response

Captured from a real request to https://api.openstreetmap.org/api/0.6/node/1 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "version": "0.6",
  "generator": "openstreetmap-cgimap 2.1.0 (3558378 spike-08.openstreetmap.org)",
  "copyright": "OpenStreetMap and contributors",
  "attribution": "http://www.openstreetmap.org/copyright",
  "license": "http://opendatacommons.org/licenses/odbl/1-0/",
  "elements": [
    {
      "type": "node",
      "id": 1,
      "lat": 42.7957187,
      "lon": 13.5690032,
      "timestamp": "2026-05-06T15:01:45Z",
      "version": 47,
      "changeset": 182299518,
      "user": "Taya_S",
      "uid": 15944521,
      "tags": {
        "…": "(9 more fields)"
      }
    }
  ]
}

Field Reference

id Unique identifier of the OSM element (node, way, or relation).
lat Latitude coordinate of the node in decimal degrees.
lon Longitude coordinate of the node in decimal degrees.
version Edit version number of the element; increments with each modification.
tags Key-value pairs that describe the feature, such as name, highway, or amenity.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.openstreetmap.org/api/0.6/node/1";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

How This API Fails

We deliberately sent this API a broken request and recorded exactly what came back on 2026-08-10. Knowing the shape of an error before you hit it makes error handling much easier to write.

HTTP 404 Requesting a path that does not exist text/html

Returned an HTML error page rather than JSON — worth knowing if your client assumes every response can be parsed as JSON.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

429 Too Many Requests The OSM API enforces strict rate limits, especially for bulk or automated requests.
Add delays between requests and cache results locally. Consider downloading OSM data extracts for large-scale use.
OAuth 401 Unauthorized Missing or incorrect OAuth credentials when trying to write or edit map data.
Register an application at openstreetmap.org, complete the OAuth flow, and include a valid access token in your request headers.
Unexpected XML response The OSM API returns XML by default, which some parsers may not handle automatically.
Parse the XML response with a library like xml2js (Node.js) or xml.etree (Python), or use the Overpass API for JSON output.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 16/30
Consistency 20/20
Security 20/20
Browser access 10/15
Transparency 8/15
Endpoint Response Time 244ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth OAuth
HTTPS NO
CORS UNKNOWN
Category Geocoding
Difficulty Advanced
Endpoint last called: 2026-08-10

Similar APIs

View All →