Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- A CDS account, accepted ERA5 licence, and CDSAPI_KEY environment variable
Global hourly climate reanalysis for building location-specific weather-history tools from a tightly bounded ERA5 extract.
From source to product signal
ERA5 is a global reanalysis on the Climate Data Store. Start with one variable, one hour, and a few-kilometer bounding box. Reanalysis blends observations and a model, so it is not a station measurement, and CDS jobs are queued rather than instant.
Install the packages, then run the notebook cell.
python -m pip install cdsapi xarray netCDF4
import os
import cdsapi
import xarray as xr
client = cdsapi.Client(
url="https://cds.climate.copernicus.eu/api",
key=os.environ["CDSAPI_KEY"],
)
client.retrieve(
"reanalysis-era5-single-levels",
{
"product_type": ["reanalysis"],
"variable": ["2m_temperature"],
"year": ["2024"],
"month": ["07"],
"day": ["15"],
"time": ["12:00"],
"area": [40.8, -74.05, 40.7, -73.95],
"data_format": "netcdf",
"download_format": "unarchived",
},
"era5_nyc_sample.nc",
)
sample = xr.open_dataset("era5_nyc_sample.nc")
print(sample)Test a useful signal
Test whether a tiny ERA5 extract can power a site-history prototype.
Copernicus Climate Change Service is an intergovernmental source. Last verified 2026-08-18. Temporal coverage: 1940-present.