How to get name, coordinates and tags to a chrome extension?


I am working on a chrome extension that utilizes OSM to get information about a location.

Essentially, once the user is at a NAMED node or way, the extension is supposed to automatically fetch its name, coordinates and location tags, and then use them to search for the same location in an outside database.

My question is how, using Javascript, am I able to scrape and collect this data?

Thank you so much.