Skip to content

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:

  1. Register an account at the Climate Data Store

  2. Obtain your API key from the CDS API How-To page

  3. 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:

julia
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
julia> using ERA5Reanalysis

julia> ckeys = ERA5Reanalysis.cdskey()
[ Info: 2026-02-08T04:02:42.449 - CDSAPI - Loading CDSAPI credentials from /home/runner/.cdsapirc ...
ERROR: SystemError: opening file "/home/runner/.cdsapirc": No such file or directory

API

ERA5Reanalysis.addCDSAPIkey Function
julia
addCDSAPIkey(
    key :: AbstractString;
    url :: AbstractString = "https://cds.climate.copernicus.eu/api/v2",
    filename  :: AbstractString = ".cdsapirc",
    overwrite :: Bool = false
) -> nothing

Adds 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 key

  • filename : The name of the file the url and key are saved to in the homedir()

  • overwrite : If true and if filename already exists, then overwrite

source