# API call on model levels

**URL:** <https://forum.ecmwf.int/t/api-call-on-model-levels/6781>\
**Category:** API\
**Created:** [10 October 2024 12:41 UTC](https://forum.ecmwf.int/t/api-call-on-model-levels/6781 "2024-10-10T12:41:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robin\_Wing](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/r/a6a055/32.png) [@Robin\_Wing](https://forum.ecmwf.int/u/Robin_Wing)\
**Post date:** [10 October 2024 12:41 UTC](https://forum.ecmwf.int/t/api-call-on-model-levels/6781/1 "2024-10-10T12:41:32Z")

</div>

I wrote a test scrip to try and get some variables of model levels. It took 4 hours and returned a file with only time and lat/lon grids. No variables.

I’ve updated my .cdsapi file. The call goes to MARS with no error messages.

Here’s there script:

import cdsapi  
c = cdsapi.Client()  
c.retrieve(‘reanalysis-era5.1-complete’, {  
‘date’ : ‘2024-08-21/to/2024-09-03’,  
‘levelist’: ‘1/to/137’,  
‘levtype’ : ‘ml’,  
‘param’ : ‘129/130/131/132/135/156/157/203’, # Param ID GP=129, T=130, u=131, v=132, w=135, GPH=156, H20=157, O3=203  
‘stream’ : ‘oper’,  
‘time’ : ‘00/to/23/by/1’,  
‘type’ : ‘an’,  
‘area’ : ‘59/7/49/17’, # North, West, South, East.  
‘grid’ : ‘0.25/0.25’,  
‘format’ : ‘netcdf’,  
}, ‘ECMWF\_operational\_ml\_20240821\_20240903.nc’) # Output file.

Can someone please tell me what I’m doing wrong? This has worked for the past 3 years.
