Documentation

overpass.ch runs the standard Overpass API. Everything you know about Overpass QL works unchanged. Only the URL is different, and it carries your API key.

Quick start

  1. Create a free account and confirm your e-mail address.
  2. Create an API key on the API keys page.
  3. Send a query:
curl https://api.overpass.ch/v1/YOUR_API_KEY/interpreter \
  --data-urlencode 'data=[out:json][timeout:25];node["amenity"="drinking_water"](47.36,8.53,47.38,8.55);out;'

The response is a normal Overpass result. Its osm3s.timestamp_osm_base field tells you how fresh the data is.

New to Overpass QL? The query examples explain 93 common queries line by line, with live results.

Endpoints

Your personal base URL is https://api.overpass.ch/v1/<API_KEY>/.

MethodPathDescription
GET, POST/v1/<KEY>/interpreterRun a query. GET with ?data=; POST with a form-encoded data= field or the raw query as body. Overpass QL and XML are both accepted.
GET/v1/<KEY>/statusYour free query slots, in the same plain-text format as /api/status on overpass-api.de, which OSMnx, OSMPythonTools and other clients read before a query. With ?format=json: your plan, limits, usage this month, running queries and the data timestamp.
GET/v1/<KEY>/timestampThe timestamp of the current data (like /api/timestamp).
GET, POST/v1/<KEY>/elevationHeight or depth of locations, or of points along a path. See Elevation API.
GET, POST/v1/<KEY>/elevation/profileElevation profile of a route or GPX track, with distance, ascent and descent.
GET/v1/<KEY>/maps/…Map tiles, styles and terrain. See Map tiles.
GET/healthzService health without authentication: HTTP 200 when the service is up and the data is current.

On overpass.ch, /status shows the slots of your key: one for each query your plan can run at the same time. When you have used up the per-minute rate, it shows when the next request is allowed. Reading /status does not count towards the rate. The upstream /api/kill_my_queries endpoint is not available, because it would affect other customers.

Authentication

Put the key in the path, as above. That's the only option for tools that let you set a server URL but no headers. Alternatively, send it in a header:

curl https://api.overpass.ch/v1/interpreter -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode 'data=node(3470507586);out;'

Treat keys like passwords. For keys used in a browser, restrict them to your websites under API keys → Allowed referers. Requests from other sites then get HTTP 403. Revoked keys stop working immediately.

Limits & plans

Limits apply per account and are shared by all its keys.

PlanRequests / monthRequests / minParallelMax. timeoutMax. maxsizeElevation lookups / monthMap tiles / month
Free10'00030160 s256 MiB1 million100'000
Small100'000unlimited2180 s512 MiB125 million100'000
Medium1'000'000unlimited4300 s1 GiB500 million100'000
Large3'000'000unlimited8600 s2 GiB1.5 billion100'000
Elevation (elevation only)–––––50 million100'000
Maps Free (added to any plan)–––––1 million100'000
Maps Small (added to any plan)–––––50 million2 million
Maps Medium (added to any plan)–––––200 million10 million
Maps Large (added to any plan)–––––500 million40 million
  • Requests per month count successful (HTTP 2xx) interpreter calls, cache hits included. The counter resets on the 1st of each month (UTC).
  • Every account has a Maps plan as well, Maps Free unless you subscribe to another one. Its map tiles and elevation lookups count when they are more than those of your Overpass or Elevation plan; the larger of the two allowances applies.
  • Requests per minute: on the free plan, a token bucket: you can send a full minute of requests at once, then it refills continuously. Paid plans have no per-minute limit; the parallel-query limit applies.
  • Parallel is the number of queries that may run at the same time.
  • Priority: when the server is busy, paid plans are served first. Free accounts can use at most half of the query slots on the server and wait at most 3 seconds for one; otherwise they get HTTP 503 server_busy and should retry a little later.

Every response includes X-RateLimit-Limit and X-RateLimit-Remaining. When a limit is hit you get HTTP 429 with a Retry-After header.

Timeout & maxsize

Overpass lets a query request a run time and memory budget with [timeout:…] and [maxsize:…] (or the timeout and element-limit attributes of <osm-script> in XML). We apply your plan as follows:

  • Values above the plan maximum are lowered to it. The query still runs.
  • If you set no value, we use the default timeout of your plan and a maxsize of 512 MiB (or the plan maximum, if lower).
  • Other settings such as [out:…], [bbox:…], [date:…] and [diff:…] pass through unchanged.

The values that applied are returned in the X-Effective-Timeout (seconds) and X-Effective-Maxsize (bytes) response headers. The settings block must be the first statement of the query. A second settings block is rejected with HTTP 400.

Errors

Errors from Overpass itself (syntax errors, timeouts, “runtime error” remarks) are passed through unchanged; Overpass errors explained covers their causes and fixes. Errors from overpass.ch are JSON: {"error": "rate_limited", "message": "…"}.

StatuserrorMeaning
400bad_queryThe settings block could not be parsed. The message says why.
400(Overpass)Syntax error in the query, with the HTML error page from Overpass.
400bad_request, too_many_locationsElevation API: malformed locations or path, or more locations than your plan allows per request.
401unauthorizedMissing, unknown or revoked API key.
403forbidden_refererThe key is restricted to other websites.
403plan_without_overpassThe Elevation plan includes the elevation API only.
413payload_too_largeThe query is larger than 1 MiB.
429rate_limitedToo many requests per minute (free plan). Wait Retry-After seconds.
429concurrency_limitToo many parallel queries for your plan.
429quota_exceededThe monthly quota is used up. Upgrade or wait for the 1st.
503server_busyThe server is at capacity (on the free plan this happens sooner, because paid plans have priority). Retry after the Retry-After seconds.
504(either)The query did not finish in time. Narrow it down or raise [timeout:] within your plan.

Caching

Identical queries within 60 seconds are answered from a cache (X-Cache: HIT). Only successful responses up to 5 MiB are cached. To force a fresh result, send Cache-Control: no-cache.

Clients

Anything that speaks Overpass works. Use https://api.overpass.ch/v1/<KEY>/ for tools that add interpreter themselves, and https://api.overpass.ch/v1/<KEY>/interpreter where a full endpoint is expected.

Overpass Turbo

Open overpass-turbo.eu → Settings → General → Server and enter:

https://api.overpass.ch/v1/YOUR_API_KEY/

Keep the trailing slash. If you restrict the key to referers, add overpass-turbo.eu. More in the Overpass Turbo guide.

JOSM

Edit → Preferences → Download (enable expert mode if needed) → Overpass server URL:

https://api.overpass.ch/v1/YOUR_API_KEY/

JOSM sends no referer. Use a key without referer restrictions.

QGIS (QuickOSM)

QuickOSM → Parameters → Add a custom Overpass server: add https://api.overpass.ch/v1/YOUR_API_KEY/ (with the trailing slash; QuickOSM appends interpreter) and select it. Older versions read it from custom_config.json: see the QuickOSM guide.

Python, R, JavaScript

Step-by-step guides: Python (requests, overpy, overpass), OSMnx, osmdata for R.

import requests

URL = "https://api.overpass.ch/v1/YOUR_API_KEY/interpreter"
query = """
[out:json][timeout:60];
area["name"="Zürich"]["admin_level"="8"]->.a;
nwr(area.a)["shop"="bakery"];
out center;
"""
r = requests.post(URL, data={"data": query}, timeout=120)
r.raise_for_status()
for el in r.json()["elements"]:
    print(el.get("tags", {}).get("name"))

Elevation API

Height above sea level on land and depth at sea, for any point on Earth, with the same API key. Every plan includes it, and the Elevation plan offers it on its own. The answers follow the format of the Google Elevation API and Open Topo Data, so clients written for those work after changing the URL.

curl 'https://api.overpass.ch/v1/YOUR_API_KEY/elevation?locations=46.0207,7.7491|35.95,-5.6'
{
  "status": "OK",
  "results": [
    { "elevation": 1606.3, "location": { "lat": 46.0207, "lng": 7.7491 },
      "surface": "land", "dataset": "copernicus-glo90", "resolution": 90 },
    { "elevation": -678.3, "location": { "lat": 35.95, "lng": -5.6 },
      "surface": "sea", "dataset": "gebco-2026", "resolution": 460 }
  ],
  "lookups": 2
}
  • locations: lat,lon|lat,lon|… or a Google encoded polyline as enc:…. For many locations, POST JSON instead: {"locations": [[lat, lon], …]} (objects with lat and lon or lng work too). Up to 10'000 locations per request on paid plans, 1,000 on Free.
  • path with samples: points evenly spread along a line, as in the Google API. Each result then also has its distance from the start in metres.
  • elevation is in metres, rounded to 0.1 m; negative at sea. It is null where there is no data. surface is land or sea; lakes and rivers count as land and return their water level.
  • Usage: one lookup per location or sample, counted only for successful requests, against the monthly allowance of your plan (separate from Overpass requests). The X-Lookups and X-Lookups-Remaining headers show the count for this request and what is left this month.

Heights in Overpass results

Add elevation=1 to the URL of an Overpass query and every node, centre and geometry point of a JSON result gets an elevation field, right after its lon:

curl 'https://api.overpass.ch/v1/YOUR_API_KEY/interpreter?elevation=1' \
  --data-urlencode 'data=[out:json];nwr["tourism"="alpine_hut"](46.0,7.6,46.2,7.9);out center;'

It uses one lookup per point, on top of the Overpass request. The X-Elevation header says added, or why the result came back unchanged: output other than JSON, more than 200,000 points, an answer larger than 32 MiB, or not enough lookups left this month.

Route profiles

/elevation/profile takes a path (as above, or as a GPX file in the POST body) and samples it every 90 m, the spacing of the data. Set interval (metres, at least 10) or samples to change that. Long routes are sampled more coarsely so that they fit into one request. Besides the points, the answer has a summary:

"profile": { "distance_m": 5087, "ascent_m": 508.4, "descent_m": 338.4,
             "min_m": 2417.2, "max_m": 2913.1, "samples": 58, "interval_m": 89.2 }
curl https://api.overpass.ch/v1/YOUR_API_KEY/elevation/profile --data-binary @track.gpx

Ascent and descent ignore changes of less than 2 m, which filters out noise in the data. To write heights into a GPX file, see add elevation to a GPX file; for profiles of OpenStreetMap routes, the elevation examples.

Elevation data and accuracy

  • Land: Copernicus DEM GLO-90, a worldwide 90 m grid from the TanDEM-X radar mission. Heights are above the EGM2008 geoid, which is close to mean sea level.
  • It is a surface model: forests and large buildings are part of the height. Values are interpolated between grid points 90 m apart, so sharp summits read lower and narrow valleys higher than the real terrain. On needle-like peaks the difference is a few hundred metres: the Matterhorn reads 4,210 m instead of 4,478 m, Everest 8,696 m instead of 8,849 m. In villages, valleys and rolling terrain it is typically within a few metres (Zermatt: 1,606 m).
  • Sea: the GEBCO grid (about 460 m) wherever Copernicus marks the ocean. Depths far from surveyed areas are estimates. Not for navigation.
  • Good for altitude bands, regional analysis, long routes, maps and enriching places. Not for engineering, aviation, drones or navigation.

Map tiles

Vector map tiles of the whole world, ready-made MapLibre styles and terrain tiles, with the same key. Every plan includes 100,000 map tiles a month, and the Maps plans have more, with a subscription of their own. For a web page, create a key of the type “Maps only” and set its allowed referers: such a key works for the endpoints below and for nothing else.

PathAnswerCounts as
/v1/<KEY>/maps/styles/<style>.jsonMapLibre style; <style> is outdoor, marine, relief, driving, light, dark, white, grayscale or black. Parameters: lang (label language, default en), hillshade=1 (shading), terrain=1 (shading and 3D terrain).free
/v1/<KEY>/maps/vector.jsonTileJSON of the vector tiles: URL template, zoom range, layers with their fields, and the date of the data.free
/v1/<KEY>/maps/vector/{z}/{x}/{y}.mvtVector tile (Mapbox Vector Tile, gzip), zoom 0 to 14.1 map tile
/v1/<KEY>/maps/terrain.jsonTileJSON of the terrain tiles.free
/v1/<KEY>/maps/terrain/{z}/{x}/{y}.pngTerrain tile, 512 × 512 px, zoom 0 to 10.1 map tile
/v1/<KEY>/maps/contours.jsonTileJSON of the contour lines.free
/v1/<KEY>/maps/contours/{z}/{x}/{y}.mvtContour lines as a vector tile (layer contours, fields ele in metres and level, 1 on the major interval), zoom 10 to 14: every 200 m at zoom 10, 100 m at 11, 50 m at 12, 20 m from zoom 13.1 map tile
/v1/<KEY>/maps/trails.jsonTileJSON of the trails.free
/v1/<KEY>/maps/trails/{z}/{x}/{y}.mvtTrails and points from the live OpenStreetMap data of our Overpass server, zoom 11 to 13 (maps enlarge zoom 13). Layer trails: grade 1 to 6 from sac_scale (1 hiking, 2 mountain hiking, 3 demanding mountain hiking, 4 alpine hiking, 5 demanding alpine, 6 difficult alpine; 0 for paths without a grade, from zoom 12), kind, name, ref, visibility. Layer points (zoom 13): bus and tram stops, stations, ferry terminals, cable car stations, drinking water and springs, with kind and name. A tile is at most 7 days old.1 map tile
/v1/<KEY>/maps/bathymetry.json, …/isobaths.json, …/seamarks.jsonTileJSON of the sea depths, the depth contours and the sea marks.free
/v1/<KEY>/maps/bathymetry/{z}/{x}/{y}.pngSea depths in the Terrain-RGB format of the terrain tiles, from GEBCO at sea and Copernicus on land, zoom 0 to 9. For colouring the sea by depth (MapLibre color-relief) and shading the sea floor.1 map tile
/v1/<KEY>/maps/isobaths/{z}/{x}/{y}.mvtDepth contours as a vector tile (layer contours, ele in metres below 0, level 1 at 100 m and every 1,000 m), zoom 5 to 12: 200 m and every 1,000 m down to zoom 7, then also 20, 50, 100 and 500 m, and from zoom 10 also 5 and 10 m.1 map tile
/v1/<KEY>/maps/seamarks/{z}/{x}/{y}.mvtSea marks from the live OpenStreetMap data of our Overpass server (the seamark:* tags), zoom 9 to 13. Layer seamarks: kind (lighthouse, light, lateral, cardinal, danger, safe_water, special, marina, harbour, anchorage, wreck, rock, mooring), colour, category, name and light in chart notation, such as Fl(2) R 6s. Lighthouses, harbours, marinas and anchorages from zoom 9, the rest from zoom 11. A tile is at most 7 days old.1 map tile
/maps/assets/fonts/…, /maps/assets/sprites/…Fonts and icons of the styles, without a key.free
new maplibregl.Map({
  container: "map",
  style: "https://api.overpass.ch/v1/YOUR_API_KEY/maps/styles/light.json?lang=de&terrain=1",
  center: [7.6586, 45.9763], zoom: 12, pitch: 60
});
  • Outdoor colours trails by their SAC grade, as on Swiss signposts: yellow for hiking trails (T1), red for mountain trails (T2 and T3), blue for alpine trails (T4 to T6); graded trails show from zoom 11. It also shows tracks, via ferratas, huts, campsites, viewpoints, stations and stops, drinking water, peaks with their height, rock, glaciers and cliffs, with hillshading and contour lines. Marine colours the sea by depth and shades the sea floor, with depth contours, the coastline, ferry routes, lighthouses and lights, buoys and beacons in their colours, harbours, marinas, anchorages, wrecks and rocks; protected areas are outlined, since many reach out to sea. Its depths come from a grid of about 460 m and are not for navigation. Driving has wider roads and shows fuel stations, charging stations and car parks. Relief colours the land by height, with hillshading and contour lines, and needs MapLibre GL JS 5.6 or later, as marine does. Light, dark, white, grayscale and black are the Protomaps styles; white, grayscale and black have no points of interest, so that your own data stands out. Outdoor, marine and driving load a second set of icons, as MapLibre allows.
  • Label languages for lang: ar, bg, cs, da, de, el, en, es, et, fa, fi, fr, ga, he, hi, hr, hu, id, it, ja, ko, lt, lv, mr, mt, ne, nl, no, pl, pt, ro, ru, sk, sl, sv, tr, uk, ur, vi, zh-Hans and zh-Hant. A region code such as de-CH uses its language. Places without a name in that language show their local name.
  • The vector tiles follow the Protomaps basemap schema, version 4, with the layers boundaries, buildings, earth, landuse, places, pois, roads and water. They also contain a landcover layer for zooms 0 to 7, which our styles leave out; if you show it, credit ESA WorldCover (CC BY 4.0). The data comes from OpenStreetMap and Natural Earth and is updated every week; data_date in the TileJSON gives the date.
  • Vector tiles go up to zoom 14, and maps enlarge zoom 14 for closer views. At street level this leaves out house numbers and most shops and restaurants. Terrain tiles go up to zoom 10, which matches the 90 m data.
  • Terrain tiles store the height in the Mapbox Terrain-RGB format: height = −10000 + (R × 65536 + G × 256 + B) × 0.1 m. The sea is 0 m and lakes have their water level. MapLibre, Mapbox GL, deck.gl and maplibre-contour read this format; in your own style, add {"type": "raster-dem", "url": "https://api.overpass.ch/v1/KEY/maps/terrain.json"} as a source.
  • Every vector or terrain tile answered with HTTP 200 counts as one map tile against the monthly allowance of your plan, which is separate from Overpass requests and elevation lookups. Tiles are sent with Cache-Control (one day for vector tiles, 30 days for terrain) and an ETag, so browsers keep them; a revalidation answered with 304 is free. A tile without data answers 204 and is free too.
  • The free plans allow up to 1,200 tiles a minute; paid plans have no per-minute limit. When the monthly allowance is used up, tiles get HTTP 429 quota_exceeded until the next month or an upgrade. We send an e-mail at 80% and at 100% of each allowance.
  • Other errors: 403 forbidden_referer (the website is not among the allowed referers of the key), 403 key_scope (a maps key used for Overpass or elevation), 403 no_map_tiles, 404 above the highest zoom, and 503 maps_unavailable or server_busy with Retry-After. Errors of map libraries and other tile services are explained in the guide Map tile API errors.

Code for Leaflet, OpenLayers and QGIS, and a live map, are on the map tiles page.

Attribution

The data is © OpenStreetMap contributors and available under the Open Database Licence. If you display or publish data obtained through overpass.ch, credit it as “© OpenStreetMap contributors” with a link to openstreetmap.org/copyright, and respect the share-alike terms for derived databases. We do not remove the copyright notice from responses.

Elevation data: when you publish or display elevation results, credit both sources. Use this notice:

Produced using Copernicus WorldDEM™-90 © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA; all rights reserved. Sea depths: GEBCO Compilation Group (2026) GEBCO 2026 Grid.

The organisations in charge of the Copernicus programme by law or by delegation do not incur any liability for any use of the Copernicus WorldDEM™-90. Neither they nor GEBCO endorse overpass.ch or your use of the data.

Map tiles: our styles and TileJSON carry the credits (overpass.ch, Protomaps, © OpenStreetMap), and MapLibre shows them in a corner of the map. Keep them visible. Maps with terrain show a short form of the Copernicus notice that links to the full notice above; the sea in terrain tiles is flat, so GEBCO is not used there. The marine style and the sea depth tiles credit GEBCO and say that the depths are not for navigation.

Fair use

  • Use one account per person or organisation; do not create accounts to get around limits.
  • Do not resell raw API access or expose your key publicly in unrestricted form (if you use a key in a public web page, set Allowed referers for it and tick “Reject requests without a referer”; do not publish keys anywhere else, for example in code repositories).
  • Prefer bounding boxes and areas over planet-wide scans. For bulk exports of whole countries, planet extracts (for example from Geofabrik) are usually a better fit.

The full rules are in the terms of service. Questions? Contact us.