# Step by step instructions on how to download data using new Climate Data Store Beta (CDS-Beta)

**URL:** <https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743>\
**Category:** C3S - Datasets and Usage\
**Created:** [5 August 2024 12:27 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743 "2024-08-05T12:27:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Odil\_Dasturlovchi](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/odil_dasturlovchi/32/508_2.png) [@Odil\_Dasturlovchi](https://forum.ecmwf.int/u/Odil_Dasturlovchi)\
**Post date:** [5 August 2024 12:27 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/1 "2024-08-05T12:27:33Z")

</div>

### 1. New ECMWF account

Your existing CDS credentials will not work in CDS-Beta  
You need to have an ECMWF account - register one [here](https://www.ecmwf.int/)

### 2. Accept all licences

Make sure that you accepted licences in the [Download form of the product page](https://cds-beta.climate.copernicus.eu/datasets/reanalysis-era5-pressure-levels?tab=download)

 ![image](https://forum.ecmwf.int/uploads/default/original/1X/ea0dae6e1a43993f1fd6dcc5ec1ddf25423d8fd8.png)

Check it from your [profile page](https://cds-beta.climate.copernicus.eu/profile). It should be like below image:

 ![image](https://forum.ecmwf.int/uploads/default/original/1X/131ccb250c595b3571b36f9359ee4a8f4a25e820.png)

### 3. Use Python 3.8 or above

You can check Python version you are using in terminal via  
`python --version`

### 4. Update the `.cdsapirc` file

Make sure that you are logged in [ECMWF](https://www.ecmwf.int/) then navigate to the [CDSAPI setup page](https://cds-beta.climate.copernicus.eu/how-to-api) to copy the content for your `.cdsapirc` file.

```auto
url: https://cds-beta.climate.copernicus.eu/api
key: <Your Personal Access Token>

```

_ **NOTE** that in new version of the file there is no [UID:] part in the key_  
You can also find your **Personal Access Token** in your [profile page](https://cds-beta.climate.copernicus.eu/profile).

### 6. Install CDS API client version 0.7 or above

Install the CDS API client is a Python based library (version 0.7 or above) using  
`pip install 'cdsapi>=0.7.0'`

### 7. Test sample download

```Python
  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)

```

Hope this helps. You can get more useful information from:

1. [CDS and ADS migrating to new infrastructure: Common Data Store (CDS) Engine](https://confluence.ecmwf.int/display/CKB/Please+read%3A+CDS+and+ADS+migrating+to+new+infrastructure%3A+Common+Data+Store+%28CDS%29+Engine)
2. [CDSAPI setup](https://cds-beta.climate.copernicus.eu/how-to-api).

---

<div class="post-metadata">

**Author:** ![Xiaobo\_Yang](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/x/e495f1/32.png) [@Xiaobo\_Yang](https://forum.ecmwf.int/u/Xiaobo_Yang)\
**Post date:** [5 August 2024 14:06 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/2 "2024-08-05T14:06:58Z")

</div>

I tried and it worked with Python 3.9.6

---

<div class="post-metadata">

**Author:** ![Jelmer\_Veenstra](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/b19c9b/32.png) [@Jelmer\_Veenstra](https://forum.ecmwf.int/u/Jelmer_Veenstra)\
**Post date:** [7 August 2024 07:13 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/3 "2024-08-07T07:13:22Z")

</div>

Thanks @Odil_Dasturlovchi for these instructions. I have a few questions/suggestions that might help improving the user experience.

Is the `https://cds-beta.climate.copernicus.eu/api` URL final or will it change in a few weeks if it is not `beta` anymore?

If one does not accept the copernicus product license they get a confusing error, can this be replaced with one that is more insightful? [CDS beta raises incorrect error about accepting licenses · Issue #108 · ecmwf/cdsapi · GitHub](https://github.com/ecmwf/cdsapi/issues/108)

Furthermore, the ~/.cdsapirc file is ok to work with, but would it not just be possible to promt for user credentials if the file does not exist (or its contents are invalid), after which the cdsapi toolbox generates/retrieves the apikey and saves the ~/.cdsapirc file?

---

<div class="post-metadata">

**Author:** ![Odil\_Dasturlovchi](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/odil_dasturlovchi/32/508_2.png) [@Odil\_Dasturlovchi](https://forum.ecmwf.int/u/Odil_Dasturlovchi)\
**Post date:** [7 August 2024 07:43 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/4 "2024-08-07T07:43:00Z")

</div>

Hi, @Jelmer_Veenstra ,

> [@Jelmer\_Veenstra](#):
>
> Is the `https://cds-beta.climate.copernicus.eu/api` URL final or will it change in a few weeks if it is not `beta` anymore?

According to @Anabelle

> You will not have to update the URL in your .cdsapirc files in the immediate future. …there should be no impact to users when we switch from CDS-Beta to CDS in September as both CDS-Beta and CDS urls will continue to [co-exist for longer](https://prod.ecmwf-forum-prod.compute.cci2.ecmwf.int/t/informative-page-in-readiness-for-new-cds-beta/2985/11)

I

> [@Jelmer\_Veenstra](#):
>
> If one does not accept the copernicus product license they get a confusing error, can this be replaced with one that is more insightful?

I agree, we can suggest it via [Support Portal](https://jira.ecmwf.int/plugins/servlet/desk/portal/1/create/202)

> [@Jelmer\_Veenstra](#):
>
> Furthermore, the ~/.cdsapirc file is ok to work with, but would it not just be possible to promt for user credentials if the file does not exist (or its contents are invalid), after which the cdsapi toolbox generates/retrieves the apikey and saves the ~/.cdsapirc file?

If you have not set up your CDS API credentials with a ~/.cdsapirc file, it is still possible to provide the credentials when initialising the cdsapi.Client. like here:

```Python
# If you have not set up your CDS API credentials with a ~/.cdsapirc file,
# it is possible to provide the credentials when initialising the cdsapi.Client.

if os.path.isfile("~/.cdsapirc"):
    cdsapi_kwargs = {}
else:
    URL = 'https://cds.climate.copernicus.eu/api/v2'
    KEY = '##################################'
    cdsapi_kwargs = {
        'url': URL,
        'key': KEY,
    }

```

I borrowed it from the [tutorials](https://ecmwf-projects.github.io/copernicus-training-c3s/glofas-bangladesh-floods.html#enter-your-cds-api-key).

---

<div class="post-metadata">

**Author:** ![Jelmer\_Veenstra](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/b19c9b/32.png) [@Jelmer\_Veenstra](https://forum.ecmwf.int/u/Jelmer_Veenstra)\
**Post date:** [7 August 2024 08:28 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/5 "2024-08-07T08:28:55Z")

</div>

Thanks for you relaborate response, very helpful.

> [@Odil\_Dasturlovchi](#):
>
> I agree, we can suggest it via [Support Portal](https://jira.ecmwf.int/plugins/servlet/desk/portal/1/create/202)

I already suggested it in `[CUS-25567]` and [CDS beta raises incorrect error about accepting licenses · Issue #108 · ecmwf/cdsapi · GitHub](https://github.com/ecmwf/cdsapi/issues/108)

---

<div class="post-metadata">

**Author:** ![Jerome\_Francis](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@Jerome\_Francis](https://forum.ecmwf.int/u/Jerome_Francis)\
**Post date:** [7 August 2024 13:51 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/6 "2024-08-07T13:51:46Z")

</div>

@Odil_Dasturlovchi how to change the request for netcdf file and specific grid resolution?

---

<div class="post-metadata">

**Author:** ![Odil\_Dasturlovchi](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/odil_dasturlovchi/32/508_2.png) [@Odil\_Dasturlovchi](https://forum.ecmwf.int/u/Odil_Dasturlovchi)\
**Post date:** [7 August 2024 14:33 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/7 "2024-08-07T14:33:07Z")

</div>

Duplicated post, deleted.

---

<div class="post-metadata">

**Author:** ![Odil\_Dasturlovchi](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/odil_dasturlovchi/32/508_2.png) [@Odil\_Dasturlovchi](https://forum.ecmwf.int/u/Odil_Dasturlovchi)\
**Post date:** [7 August 2024 14:34 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/8 "2024-08-07T14:34:11Z")

</div>

> [@Jerome\_Francis](#):
>
> @Odil_Dasturlovchi how to change the request for netcdf file and specific grid resolution?

```auto
'data_format': 'netcdf',
# if you are looking sub-region extraction 
'area': [90, -180, -90, 180]
# if you are looking to grid (interpolated)
'grid': '0.5/0.5',
# for original grid
# 'grid': 'original_grid',

```

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Jerome\_Francis](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@Jerome\_Francis](https://forum.ecmwf.int/u/Jerome_Francis)\
**Post date:** [7 August 2024 15:24 UTC](https://forum.ecmwf.int/t/step-by-step-instructions-on-how-to-download-data-using-new-climate-data-store-beta-cds-beta/3743/9 "2024-08-07T15:24:20Z")

</div>

thnx @Odil_Dasturlovchi
