Download ERA5 via API; complete but requst restarted

Hi all,

On Friday I started a request for data downloading via the CDS Api. When I log in to https://cds.climate.copernicus.eu/ and go to “My request”, the status of the file I requested is “Complete” and I can click the button “Download”. However, if I use the CDS Api and send the same request as on Friday, a new request is started, although the data is already there ready to be downloaded. In the old CDS, I did not face any problems with that. So: How can I download the data file, which has status “Complete”, via the CDS Api? I have lots of files to downlaod such that clicking the “donwload” button does not work for me.

Has anybody else encountered this problem?

Thank you in advance

Amelie

Your requests return an instance which you can query from time to time.

r = client.retrieve(dataset, request)
target = '/your/directory/for/data'
r.download(target)

This assumes that you do not drop out of the current script / session and cycle through all requests on a schedule which does not trigger rate limiters (don’t spam the server by looping through things unnecessarily).

What do you mean by “not drop out of current script/session”?

If you start your download script: download.py you will have to keep it running to check on the status of your calls r. By default, or in this example you don’t see the API endpoint associated with your call and downloads (as wrapped in r).

Maybe you can expose the API endpoints, and save them separately. If you can save them separately and you know the downloads take a long time you can save them to disk, and write a script which checks or resumes the download later (without leaving a python script/session running.