Downloading data on 2 PVU level using CDS API

Hello,

I am currently trying to download ERA5 potential temperature, pressure, geopotential, u, v on a 2 PVU level. I am trying to use the CDS API and Python. Here was my code:

c = cdsapi.Client()
c.retrieve(‘reanalysis-era5-complete’, {
‘class’: ‘ea’,
‘year’: ‘2025’,
‘month’: ‘02’,
‘day’: ‘12/13/14/15/16/17/18’,
‘expver’: ‘1’,
‘levelist’: ‘2000’,
‘levtype’: ‘pv’,
‘param’: ‘3.128/54.128/129.128/131.128/132.128’, # Theta, pressure, geopotential, u, v
‘stream’: ‘oper’,
‘time’: ‘00:00:00/06:00:00/12:00:00/18:00:00’,
‘type’: ‘an’,
‘format’: ‘netcdf’, # Supported format: grib and netcdf. Default: grib
‘area’: [65, -170, 20, -50], # North, West, South, East. Default: global
‘grid’: [0.25, 0.25], # Latitude/longitude grid. Default: 0.25 x 0.25
}, outfile)

I keep getting 400 errors. Any help or guidance on how to get this data would be much appreciated!

Best,
Troy

Here is the fix:

c = cdsapi.Client()
c.retrieve(“reanalysis-era5-complete”, {
“class”: “ea”,
“date”:“2025-02-12/to/2025-02-18”,
“expver”: “1”,
“levelist”: “2000”,
“levtype”: “pv”,
“param”: “3.128/54.128/129.128/131.128/132.128/133.128/203.128”,
“stream”: “oper”,
“grid”:“0.25/0.25”,
“area”:“65/-170/20/50”,
“format”:“netcdf”,
“time”: “00:00:00/01:00:00/02:00:00/03:00:00/04:00:00/05:00:00/06:00:00/07:00:00/08:00:00/09:00:00/10:00:00/11:00:00/12:00:00/13:00:00/14:00:00/15:00:00/16:00:00/17:00:00/18:00:00/19:00:00/20:00:00/21:00:00/22:00:00/23:00:00”,
“type”: “an”
}, “output.nc”)