If you have the api request for a day in january 2022 (that you can get in the cds website using a form) you only have to change two things:
- add a for cicle before c.retrieve( -and watch the identation-
- replace the day in the format for a %s
An example:
#!/usr/bin/env python3
import cdsapi
c = cdsapi.Client()
for x in range(1,32):
c.retrieve(
'reanalysis-era5',
{
'variable': '2m_dewpoint_temperature',
'year': '2022',
'month': '01',
'day': '%s'%x,
'time': [
'00:00', '01:00', '02:00',
'03:00', '04:00', '05:00',
'06:00', '07:00', '08:00',
'09:00', '10:00', '11:00',
'12:00', '13:00', '14:00',
'15:00', '16:00', '17:00',
'18:00', '19:00', '20:00',
'21:00', '22:00', '23:00',
],
'area': [
21, -104, 20,
-103,
],
'format': 'grib',
},
'TP_01_%s.grib'%x)