Hi,
I recently tried using the new beta version of the API and encountered an issue that I thought might interest you. Even when following the official example provided, I’m faced with an error. Here’s the code I used:
import cdsapi
client = cdsapi.Client()
dataset = 'reanalysis-era5-pressure-levels'
request = {
'product_type': ['reanalysis'],
'variable': ['geopotential'],
'year': ['2024'],
'month': ['03'],
'day': ['01'],
'time': ['13:00'],
'pressure_level': ['1000'],
'data_format': 'grib',
}
target = 'download.grib'
client.retrieve(dataset, request, target)
However, I’m getting the following error:
HTTPError: 404 Client Error: Not Found for url: https://cds-beta.climate.copernicus.eu/api/resources/reanalysis-era5-pressure-levels
During handling of the above exception, another exception occurred:
I’m puzzled as to why this is happening. Is it possible that the new version of the API is not ready for data downloads yet? I would appreciate any insights you might have on this issue.
Best regards,
Wang
hi Wang, i just tried your request and it ran ok:
% more forum.py
import cdsapi
client = cdsapi.Client()
dataset = 'reanalysis-era5-pressure-levels'
request = {
'product_type': ['reanalysis'],
'variable': ['geopotential'],
'year': ['2024'],
'month': ['03'],
'day': ['01'],
'time': ['13:00'],
'pressure_level': ['1000'],
'data_format': 'grib',
}
target = 'download.grib'
client.retrieve(dataset, request, target)
% python3 forum.py
2024-07-25 11:05:47,241 INFO Request ID is 57bff2df-7096-4d09-a380-0b3d5094c837
2024-07-25 11:05:47,292 INFO status has been updated to accepted
2024-07-25 11:05:48,871 INFO status has been updated to running
2024-07-25 11:05:51,249 INFO status has been updated to successful
% ls -lt download.grib
-rw-r--r-- 1 * * 2076588 25 Jul 11:05 download.grib
So it may have been a temporary issue on cds-beta
Kevin
Hi Kevin,
Thanks for your reply. I suspect there might be an issue with my .cdsapirc file configuration. I’ve set it up as follows:
url: https://cds-beta.climate.copernicus.eu/api
key: UID (formatted as ********-****-****-****-************):Personal Access Token (tried both uppercase and lowercase, but no success)
Unfortunately, it didn’t work. Any new suggestions?
Best regards,
Wang
Maybe set your file as follows:
url: https://cds-beta.climate.copernicus.eu/api
key: [key here]
The inclusion of your UID within the .cdsapirc file is gone for the CDS-beta system. In the past you indeed needed to list both user id & key, now just the key.
The old one looked like:
But the new one looks like:
The other topic post on this.
also, if you logon to the CDS-beta and go to
https://cds-beta.climate.copernicus.eu/how-to-api
you should see your details for what should be included in your .cdsapirc file