overpass-api.de: “406 Not Acceptable”
Since 19 April 2026, the public server at overpass-api.de refuses scripts that send the default user agent of their HTTP library, or none at all. They get HTTP 406 Not Acceptable with a short nginx page.
User-Agent header that names your application and a way to reach you, such as shop-map/1.2 (+https://example.com/contact). Pages in a browser must send a Referer. For regular or commercial use, the operators ask you to use another server.
What the answer looks like
The response comes from nginx, in front of Overpass, so it does not contain an Overpass error message:
HTTP/1.1 406 Not Acceptable Content-Type: text/html <html> <head><title>406 Not Acceptable</title></head> <body> <center><h1>406 Not Acceptable</h1></center> <hr><center>nginx</center>
We got this answer on 4 November 2026 with the user agent of python-requests 2.32. Libraries show it in their own way: requests raises HTTPError: 406 Client Error: Not Acceptable, overpy raises OverpassUnknownHTTPStatusCode with code 406, and R prints HTTP 406 Not Acceptable.
Why the server refuses you
overpass-api.de is run by volunteers of the FOSSGIS association and is overloaded. On 19 April 2026 its operators put blocking rules in place and listed them in the OpenStreetMap forum:
- Scripts must set their own user agent that identifies them well. Stock user agents, fake ones and rotating ones are refused.
- Requests from a browser must include a referrer.
- One user, one script: do not spread queries over several scripts, servers or cloud workers.
- Commercial users should run their own server or use a commercial provider.
A stock user agent is the one a library sends when you set none, such as python-requests/2.32.3, Python-urllib/3.12 or curl/8.5.0. The list of refused strings is not published. Blocks by user agent or referrer are also set by hand, and those get a 406 as well.
Set a user agent
Name the application, its version and a contact: a web page or an e-mail address. Use the same user agent on every request, and a different one for each application.
Python with requests
import requests
HEADERS = {"User-Agent": "shop-map/1.2 (+https://example.com/contact)"}
query = "[out:json][timeout:25];node[amenity=drinking_water](46.51,6.62,46.53,6.65);out;"
r = requests.post("https://overpass-api.de/api/interpreter",
data={"data": query}, headers=HEADERS, timeout=60)
r.raise_for_status()
print(len(r.json()["elements"]))
overpy
overpy sends its requests with urllib and does not have a setting for headers, so it sends Python-urllib/3.x. Install an opener with your user agent before the first query; overpy then uses it:
import urllib.request
import overpy
opener = urllib.request.build_opener()
opener.addheaders = [("User-Agent", "shop-map/1.2 (+https://example.com/contact)")]
urllib.request.install_opener(opener)
api = overpy.Overpass()
result = api.query("node[amenity=drinking_water](46.51,6.62,46.53,6.65);out;")
The opener applies to every urllib request of the program.
overpass (Python package)
Without a user_agent, the package sends Unknown overpass-api-python-wrapper application:
import overpass api = overpass.API(user_agent="shop-map/1.2 (+https://example.com/contact)", timeout=60)
OSMnx
OSMnx sends the same user agent and referer for every OSMnx script in the world. Set your own:
import osmnx as ox ox.settings.http_user_agent = "thesis-streets/0.3 (jane.doe@example.org)" ox.settings.http_referer = "https://example.org/thesis"
osmdata (R)
library(osmdata) options(osmdata.user_agent = "flood-study/1.0 (jane.doe@example.org)")
curl
curl -A "shop-map/1.2 (+https://example.com/contact)" \ --data-urlencode "data@query.overpassql" \ https://overpass-api.de/api/interpreter
JavaScript
In Node.js, set the header in fetch:
const r = await fetch("https://overpass-api.de/api/interpreter", {
method: "POST",
headers: { "User-Agent": "shop-map/1.2 (+https://example.com/contact)" },
body: new URLSearchParams({ data: query }),
});
In a browser, the browser sends its own user agent (Chrome does not let scripts change it), and the page has to send a Referer. A Referrer-Policy: no-referrer header, set by Helmet, Django or nginx, removes it. The guide on blocked map tiles shows where to change that setting. Opening an interpreter URL straight in the address bar is refused too, because there is no referrer.
QGIS and Overpass Turbo
QGIS adds Mozilla/5.0 to the user agent of plugins, so the operators exempted the QGIS user agent; QuickOSM works without changes. Overpass Turbo runs in the browser and sends a referrer.
Still 406 with your own user agent
- Your user agent or site was blocked by hand. Switching to a new user agent to get around the block is the rotation that the rules forbid. Ask in the help section of the OpenStreetMap forum.
- Your page runs on a platform for AI-generated apps. On 11 August 2026 the operators wrote that they had banned many such platforms, for example lovable.app and netlify.app. Requests from pages hosted there carry that referrer.
- The browser does not send a referrer. Check the request in the developer tools of the browser, tab Network.
After a 406, wait at least 30 seconds before the next request. Clients that keep getting 406 or 429 are banned by IP address; see banned from overpass-api.de.
Another server
For an application or a regular job, the public server is the wrong place: its policy on the OpenStreetMap wiki counts the requests of all users of an app or website together, and asks commercial users to use self-hosted or paid servers. The alternatives guide compares the options.
overpass.ch identifies you by your API key and accepts any user agent. Your queries stay the same; only the URL changes:
https://overpass-api.de/api/interpreter
→ https://api.overpass.ch/v1/YOUR_API_KEY/interpreter