Proper query of OSM APIs and 'polygons.openstreetmap.fr'

Hi, I’m pretty new to OSM. I’m working on web application in WebGL, and I have 2 major questions:

  1. I would like to know how to correctly query for city boundaries polygon. I’ve tried to use JSONP and http.get requests to get data form ‘http://polygons.openstreetmap.fr/get_geojson.py?id=1582777’ but i cant get it, because of CORS policy. This server seems to be JSONP disabled. Does any other kind of similar API exists?

  2. To get proper relations of my address i’m querying ‘nominatim.openstreetmap.org’ multiple times, every time constructing new url. Query for address to get city, city to get country, etc. This works but feels really tiresome. How do I query nominatim, knowing street address and getting all info that I need (city, country, continent) ?

Can you give me some hints?

Same question was also posted here: