Is it possible to export the coordindates of a way?

On OpenSteetMap it is possible to define ways [0] which are basically a sequence of nodes. Is there a way to fetch the coordinates of the nodes constructing this way in an automated manner (via API) just by providing the ID of the way?

The idea is to get a defined way onto a Leaflet map just by providing the ID.

Thanks for suggestions, pointers etc. and most importantly for your time.

[0] https://www.openstreetmap.org/way/27040489

Hi and welcome to OSM and the forum.

Please reade https://wiki.openstreetmap.org/wiki/API_v0.6

What you are looking for is https://wiki.openstreetmap.org/wiki/API_v0.6#Full:GET.2Fapi.2F0.6.2F.5Bway.7Crelation.5D.2F.23id.2Ffull I assume.

Thanks for the pointer!