Dear all,
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:
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
No idea what is exactly wrong, but given the same remade request, I got the data. The only difference is the " instead of ’ around the dataset name (& use of Pathlib).
WIth the following code-block I was able to retreive the data:
Hi Laurens_Stoop,
Thank you for your prompt response. I have reviewed and followed the API usage tutorial for the Windows system as per the instructions provided on the website. However, when I attempted to utilize the tutorial for Linux, I encountered an error stating that I was missing a “uid”. Additionally, it appears that the Windows tutorial may be outdated.
To address this issue, I combined the updated URL with the information from the Windows tutorial and configured the .cdsapirc file as follows:
url: https://cds-beta.climate.copernicus.eu/api
key: User ID0:Personal Access Token
Unfortunately, this configuration did not resolve the problem. I would greatly appreciate any further guidance or assistance you could provide. Please let me know if there are any additional steps I need to take or if there are alternative solutions available.
Thank you once again for your help. I look forward to your response.
Make sure to login to the CDS-beta system. Both during the making of the request (to accept the license of the dataset) and during the visit to the guide page!
If you are not logged in, then your personal key won’t show on the ‘How-to’ page.
Dear Michela,
Thank you for your reply. I have obtained the necessary permissions (four in total). The web download is working, but the API is not.
Best regards,
Wang
Hi Laurens_Stoop,
Thanks for your response. I’ve logged in and registered on the new site, and used the new key as previously mentioned, but unfortunately, it still failed. I can’t seem to pinpoint the issue.QWQ
No worries, have you explicitely also accepted the license for the pressure level data of ERA5?
While I accepted the license for ERA5 single level variables, I needed to also accept the presure level data license. It seems that each dataset has its own license (for reasons).
Yes, I’ve already accepted it. I suspect there might be an issue with the content of the .cdsapirc file. Here’s how I’ve set it up:
url: https://cds-beta.climate.copernicus.eu/api
key: UID (formatted as ********-****-****-****-************):Personal Access Token (I've tried both uppercase and lowercase, but both resulted in failure)
Are you also using a Windows system? Could you please help me check if this format is correct?
Thank you very much~
N.B.: 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 (i.e. DO NOT USE THIS IN CDS-BETA):
But the new one looks like (USE THIS):
Thank you for your suggestion. I updated this library at the beginning, and it also shows 0.7.0. It seems there’s no issue? I’ve also tried uninstalling and reinstalling this library, and it’s still the same version.
Wang
Last wild-card idea: Are you sure the .cdsapirc file has no extension (like a hidden file extension in windows)? mine was initially named .cdsapirc.txt & got me weird issues on windows.
Fix: open Windows explorer → go to the view tab → check the field of ‘file name extensions’ & then check if the .cdsapirc file located at C:\Users\[your_username]\ is indeed reading .cdsapirc.
Please take the key from this link after you log in: Climate Data Store
Please also make sure that the required python packages are updated to the latest version.
Thanks