How do I use Overpass to retrieve just a list matching objects?

Here is an example query that’s close to what I’m looking for:

[date:"2023-05-29T00:00:00Z"];
way["shop"="fireplace"]({{bbox}});
out;

I get the data, but with all the tags on those objects. I’m looking for just the objects (in any format) - in this case just a list of way IDs, without the tags. There’s probably some variant of “out” that does this but the OSM wiki is unhelpful.

I use something like [out:csv (::id, ::type)] in front of the [date..].

For example:

[out:csv(::id,::type, ::lat,::lon, shop, name, brand,  "addr;housenumber","addr:street",   "addr:city"; true; ",")][date:"2020-01-01T00:00:00"]
[timeout:2500];
{{geocodeArea: Nottingham, England }}->.searchArea;
  nwr[shop](area.searchArea);
// print results
out center;

The csv format allows larger volumes of data to be retrieved, presumably because more work is done server side. For instance drop the date clause and change the area to USA and you can get all the shops (~500k).

Edited to remove a union clause "( ... );" which also found nodes of ways (see comments).

1 Like
[date:"2023-05-29T00:00:00Z"];
way[shop=fireplace]({{bbox}});
out ids;

https://overpass-turbo.eu/s/1ER7