We have to reverse geocode 1000's of address and want the output of the queries in a csv/txt format. Currently if i run this query in a browser
https://nominatim.openstreetmap.org/reverse?format=xml&lat=15.052367&lon=-23.4668449999999&zoom=18&addressdetails=1
getting proper results
<result place_id="162512055" osm_type="way" osm_id="388397021" ref="Ribeira de São Domingos" lat="15.0517782" lon="-23.4655677" boundingbox="15.0345067,15.052133,-23.4811055,-23.4651987">
Ribeira de São Domingos, Achada Baleia, São Domingos, Cape Verde
</result>
<addressparts>
<road>Ribeira de São Domingos</road>
<village>Achada Baleia</village>
<county>São Domingos</county>
<country>Cape Verde</country>
<country_code>cv</country_code>
</addressparts>
</reversegeocode>
How to save this output directly to a csv or a txt file with respective headers ?