Assuming one builds a simple websearch and wants to display POIs as single markers based on the data in Openstreetmap. It is very easy to query this data with overpass when one is searching for nodes.
It is also possible though that the data is attached to ways/areas and not nodes. In that case overpass returns all the nodes and tells you which nodes make up the areas. This makes handling the response more difficult in a library like leaflet because one needs to handle those possibilities (node/area) differently. What would be sufficient for my example would just be something like the centroid of the area (read: a single node per area) though.
Is there a way to query for this in overpass or a similar service?