The API method is simple, but requires specifying 4 coordinates (in the correct order...).
In the end, I found it much easier to do with this script, where I can pass "top left URL" and "bottom right URL" from osm.org:
https://github.com/richlv/osmnotes
Example:
perl osmnotes.pl --topleft 'https://www.openstreetmap.org/#map=18/57.08172/24.32869&layers=N' --bottomright 'https://www.openstreetmap.org/#map=18/57.07927/24.33861' --closed 70
Disclaimer: I wrote that script some time ago.