[adiff:…] runs the query at two dates and compares the answers. The result lists what was added, what changed and what was deleted; a changed element comes with its old and its new version.
This query lists the changes around Paradeplatz in Zürich between 1 October 2024 and 1 January 2025. Diffs are available in XML only: with [out:json], Overpass refuses the query.
The query
[out:xml][timeout:60][adiff:"2024-10-01T00:00:00Z","2025-01-01T00:00:00Z"]; nw(47.370,8.538,47.372,8.542)(if:count_tags()>0); out meta geom;
Run it
Live result from overpass.ch, cached for up to 12 hours. Map data © OpenStreetMap contributors (ODbL).
How it works
[adiff:"2024-10-01T00:00:00Z","2025-01-01T00:00:00Z"]gives the two dates. With one date, Overpass compares it with the current data.(if:count_tags()>0)leaves out the untagged nodes of ways. When such a node moves, the way shows up as changed, sometimes with the same version number.out meta geom;prints each version with its tags, coordinates, version number, time and user.- Each change is an
<action>:createfor what was added,modifywith an<old>and a<new>version,deletefor what is gone. A deleted object hasvisible="false"in<new>; without it, the object still exists and no longer matches the query. - Most rows come from edits of the tram tracks on 11 November 2024: moved nodes and the ways that use them. Outdoor seating was added at four places, and the Junobrunnen fountain was redrawn: its point lost its tags and a new outline took its place.
Variations
[diff:…]gives the same changes without the new version of what is gone, so it cannot tell a deleted object from one that no longer matches.- Only what was added or deleted: add
compare(delta:id());beforeout, as in deleted objects in an area. - With relations (
nwrinstead ofnw) this query took ten times as long, and the answer was 20 times larger. - To follow the edits in an area, run it every day with the day before as the only date.
Run it from your code
curl https://api.overpass.ch/v1/YOUR_API_KEY/interpreter \
--data-urlencode 'data@query.overpassql'
import requests
query = open("query.overpassql").read()
r = requests.post("https://api.overpass.ch/v1/YOUR_API_KEY/interpreter",
data={"data": query}, timeout=120)
r.raise_for_status()
print(r.text)
const res = await fetch("https://api.overpass.ch/v1/YOUR_API_KEY/interpreter", {
method: "POST",
body: new URLSearchParams({ data: query }),
});
if (!res.ok) throw new Error(await res.text());
console.log(await res.text());
Save the query as query.overpassql. It works the same in Overpass Turbo, QGIS and JOSM.