# Download ERA5 data by R

**URL:** <https://forum.ecmwf.int/t/download-era5-data-by-r/3423>\
**Category:** API\
**Created:** [24 July 2024 11:08 UTC](https://forum.ecmwf.int/t/download-era5-data-by-r/3423 "2024-07-24T11:08:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hejie\_wang](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/h/ed8c4c/32.png) [@hejie\_wang](https://forum.ecmwf.int/u/hejie_wang)\
**Post date:** [24 July 2024 11:08 UTC](https://forum.ecmwf.int/t/download-era5-data-by-r/3423/1 "2024-07-24T11:08:15Z")

</div>

I would like to know how to download ERA5 data via R currently

---

<div class="post-metadata">

**Author:** ![Kevin\_Marsh](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/kevin_marsh/32/368_2.png) [@Kevin\_Marsh](https://forum.ecmwf.int/u/Kevin_Marsh)\
**Post date:** [24 July 2024 20:46 UTC](https://forum.ecmwf.int/t/download-era5-data-by-r/3423/2 "2024-07-24T20:46:32Z")

</div>

this forum post describes how R can be used to access ERA5 data from the current CDS. Please note the recommended way to access ERA5 data is via the CDS API

> [@Download CDS ERA5 data using R](https://prod.ecmwf-forum-prod.compute.cci2.ecmwf.int/t/download-cds-era5-data-using-r/1365):
>
> Users can download CDS data using the&nbsp;[ecmwfr](https://cran.r-project.org/web/packages/ecmwfr/index.html) package&nbsp;in R with&nbsp;“cds” as the "service" although it is not supported by C3S. In the examples below, "KEY" and "UID" are your CDS API key and UID respectively. Please have a look at the following example to download ERA5 2m temperature for a selected area in netCDF format:&nbsp; library(ecmwfr) &nbsp; cds.key \<- "Insert\_your\_CDS\_API\_KEY\_here" wf\_set\_key(user = "Insert\_your\_CDS\_UID\_here", key = cds.key, service = "cds") …

---

<div class="post-metadata">

**Author:** ![Koen\_Hufkens](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/koen_hufkens/32/526_2.png) [@Koen\_Hufkens](https://forum.ecmwf.int/u/Koen_Hufkens)\
**Post date:** [16 August 2024 17:11 UTC](https://forum.ecmwf.int/t/download-era5-data-by-r/3423/3 "2024-08-16T17:11:08Z")

</div>

Hi @hejie_wang, I’m the developer of the R package and you can find extensive documentation on the github pages website.

> **[Interface to ECMWF and CDS Data Web Services](https://bluegreen-labs.github.io/ecmwfr/)**
>
> Programmatic interface to the European Centre for Medium-Range Weather Forecasts dataset web services (ECMWF; ) and Copernicus's Climate Data Store (CDS; ). Allows for easy downloads of weather forecasts and climate reanalysis data in R.

A note of caution, as it stands due to the lack of transparency in the API structure of the new C/ADS-beta I’m unsure I can keep support going. This is a shame as this will pull with it other downstream dependent innovative R packages (including peer reviewed scientific work [Radware Bot Manager Captcha](https://iopscience.iop.org/article/10.1088/1748-9326/ac48b3)).

@Kevin_Marsh I hope I (and others) can get more information to keep the R ecosystem alive without resorting to clunky solutions such as reticulate, i.e. running a python VM in R. The NASA Appeears project has done this nicely, providing true open source API support, to their API.

---

<div class="post-metadata">

**Author:** ![Koen\_Hufkens](https://forum.ecmwf.int/user_avatar/forum.ecmwf.int/koen_hufkens/32/526_2.png) [@Koen\_Hufkens](https://forum.ecmwf.int/u/Koen_Hufkens)\
**Post date:** [8 November 2024 20:07 UTC](https://forum.ecmwf.int/t/download-era5-data-by-r/3423/4 "2024-11-08T20:07:47Z")

</div>

@hejie_wang Update on the status of things. The package has been updated to work with the current API.

> **[Interface to ECMWF and CDS Data Web Services](https://bluegreen-labs.github.io/ecmwfr/)**
>
> Programmatic interface to the European Centre for Medium-Range Weather Forecasts dataset web services (ECMWF; ) and Copernicus's Data Stores. Allows for easy downloads of weather forecasts and climate reanalysis data in R. Data stores covered include...

You can now use R again to download data from CDS, ADS and emergency services.
