I have to make simple exchange web, using data from bank. Ive downloaded it and stored in data. Here's my code:
import requests
response = requests.get("http://api.nbp.pl/api/exchangerates/tables/C?format=json")
data = response.json()
Now the problem is how to take "rates" list from it and make a CSV file based on that list, that looks like this:
[
{
"table": "C",
"no": "215/C/NBP/2021",
"tradingDate": "2021-11-04",
"effectiveDate": "2021-11-05",
"rates": [
{
"currency": "dolar amerykański",
"code": "USD",
"bid": 3.9437,
"ask": 4.0233
},
{
"currency": "dolar australijski",
"code": "AUD",
"bid": 2.9158,
"ask": 2.9748
},
{
"currency": "dolar kanadyjski",
"code": "CAD",
"bid": 3.1679,
"ask": 3.2319
},
# more here
]
}
]
I have no idea how to make it. Can anyone help ?