Setting up the CDS API
ERA5Reanalysis.jl downloads data from the Copernicus Climate Data Store (CDS), which requires registering an account to access the data. The steps are as follows:
Register an account at the Climate Data Store
Obtain your API key from the CDS API How-To page
Set up your API key using ERA5Reanalysis.jl
If this sounds complicated however, fear not! You need only perform the first two steps yourself (i.e., create your own account and retrieve your API key). Once you have your API key, you can use the function addCDSAPIkey() to set it up:
using ERA5Reanalysis
addCDSAPIkey("<your-api-key-here>")The API key format is typically <user-id>:<api-key>, for example: 123456:abcd1234-ef56-gh78-ij90-klmn12345678
Verifying Your Setup
You can verify that your CDS API key is set up correctly by checking the key:
julia> using ERA5Reanalysis
julia> ckeys = ERA5Reanalysis.cdskey()
[36m[1m[ [22m[39m[36m[1mInfo: [22m[39m2026-02-08T04:02:42.449 - CDSAPI - Loading CDSAPI credentials from /home/runner/.cdsapirc ...
ERROR: SystemError: opening file "/home/runner/.cdsapirc": No such file or directoryAPI
ERA5Reanalysis.addCDSAPIkey Function
addCDSAPIkey(
key :: AbstractString;
url :: AbstractString = "https://cds.climate.copernicus.eu/api/v2",
filename :: AbstractString = ".cdsapirc",
overwrite :: Bool = false
) -> nothingAdds the user's CDSAPI key to a file in the homedir() (by default specified as .cdsapirc)
Arguments
key: The user's CDSAPI key
Keyword Arguments
url: The user's CDSAPI keyfilename: The name of the file the url and key are saved to in thehomedir()overwrite: Iftrueand iffilenamealready exists, then overwrite