Unable to download ERA-Interim Total Precipitation

Dear All,
I am following scripit to download ERA-Interim Total Precipitation using following code: ERA-Interim: How to calculate daily total precipitation - Copernicus Knowledge Base - ECMWF Confluence Wiki
I tried all solutions but not able to fix it. I am facing following error: {
“name”: “Exception”,
“message”: “an internal error occurred processing your request. mars - ERROR - 20240628.075829 - Last error is -43
mars - ERROR - 20240628.075829 - Expected 4, got 2.
mars - ERROR - 20240628.075829 - Request failed
mars - ERROR - 20240628.075829 - Some errors reported (last error -1).”,
“stack”: "---------------------------------------------------------------------------
Exception Traceback (most recent call last)
Cell In[5], line 5
2 import cdsapi
4 c = cdsapi.Client()
----> 5 c.retrieve(‘reanalysis-era-interim’, {
6 ‘date’: ‘2018-01-01’,
7 ‘levtype’: ‘sfc’,
8 ‘param’: ‘228’,
9 ‘stream’: ‘oper’,
10 ‘time’: ‘00/12’,
11 ‘type’: ‘fc’,
12 ‘step’: ‘00/to/12’,
13 ‘area’: ‘80/-50/-25/0’,
14 ‘grid’: ‘0.75/0.75’,
15 ‘format’: ‘netcdf’,
16 }, ‘ERAI-pl-temperature-subarea.nc’) # Output file. Adapt as you wish.

File ~/miniconda3/envs/irrigation/lib/python3.12/site-packages/cdsapi/api.py:381, in Client.retrieve(self, name, request, target)
380 def retrieve(self, name, request, target=None):
→ 381 result = self._api("%s/resources/%s" % (self.url, name), request, "POST")
382 if target is not None:
383 result.download(target)

File ~/miniconda3/envs/irrigation/lib/python3.12/site-packages/cdsapi/api.py:536, in Client._api(self, url, request, method)
534 break
535 self.error(" %s", n)
→ 536 raise Exception(
537 "%s. %s."
538 % (reply["error"].get("message"), reply["error"].get("reason"))
539 )
541 raise Exception("Unknown API state [%s]" % (reply["state"],))

Exception: an internal error occurred processing your request. mars - ERROR - 20240628.075829 - Last error is -43
mars - ERROR - 20240628.075829 - Expected 4, got 2.
mars - ERROR - 20240628.075829 - Request failed
mars - ERROR - 20240628.075829 - Some errors reported (last error -1)."
}

Corrected indentation

import cdsapi

c = cdsapi.Client()
c.retrieve(‘reanalysis-era-interim’, {
‘date’: ‘2018-01-01’,
‘levtype’: ‘sfc’,
‘param’: ‘228’,
‘stream’: ‘oper’,
‘time’: ‘00/12’,
‘type’: ‘fc’,
‘step’: ‘00/12’,
‘area’: ‘60.255/-10.255/25.111/30.455’,
‘grid’: ‘0.75/0.75’,
‘format’: ‘netcdf’,
}, ‘ERAI-pl-temperature-subarea.nc’) # Output file. Adapt as you wish.

I just changed the ‘step’ line in the script to
“step”: “3/6/9/12”
and it worked ok:
python3 erai_request.py
2024-07-03 16:22:58,330 INFO Welcome to the CDS
2024-07-03 16:22:58,330 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era-interim
2024-07-03 16:22:58,413 INFO Request is queued
2024-07-03 16:24:52,380 INFO Request is completed
2024-07-03 16:24:52,384 INFO Downloading https://download-0013-clone.copernicus-climate.eu/cache-compute-0013/cache/data8/adaptor.mars.external-1720020257.0844438-28333-13-3cb3e54b-c90d-4717-9403-00e3b46525c7.nc to ERAI-pl-temperature-subarea.nc (149.5K)
2024-07-03 16:24:53,049 INFO Download rate 225.1K/s

% ncdump -h ERAI-pl-temperature-subarea.nc
netcdf ERAI-pl-temperature-subarea {
dimensions:
longitude = 67 ;
latitude = 141 ;
time = 8 ;
variables:
float longitude(longitude) ;
longitude:units = “degrees_east” ;
longitude:long_name = “longitude” ;
float latitude(latitude) ;
latitude:units = “degrees_north” ;
latitude:long_name = “latitude” ;
int time(time) ;
time:units = “hours since 1900-01-01 00:00:00.0” ;
time:long_name = “time” ;
time:calendar = “gregorian” ;
short tp(time, latitude, longitude) ;
tp:scale_factor = 5.64174475431271e-07 ;
tp:add_offset = 0.0184857408383964 ;
tp:_FillValue = -32767s ;
tp:missing_value = -32767s ;
tp:units = “m” ;
tp:long_name = “Total precipitation” ;

// global attributes:
:Conventions = “CF-1.6” ;
:history = “2024-07-03 15:24:17 GMT by grib_to_netcdf-2.28.1: /opt/ecmwf/mars-client/bin/grib_to_netcdf -S param -o /cache/data8/adaptor.mars.external-1720020257.0844438-28333-13-3cb3e54b-c90d-4717-9403-00e3b46525c7.nc /cache/tmp/3cb3e54b-c90d-4717-9403-00e3b46525c7-adaptor.mars.external-1720020256.1462054-28333-5-tmp.grib” ;
}