# How to download "surface pressure" using cdsapi from ERA5.complete

**URL:** <https://forum.ecmwf.int/t/how-to-download-surface-pressure-using-cdsapi-from-era5-complete/1491>\
**Category:** API\
**Tags:** api, c3s, era5\
**Created:** [25 February 2023 06:07 UTC](https://forum.ecmwf.int/t/how-to-download-surface-pressure-using-cdsapi-from-era5-complete/1491 "2023-02-25T06:07:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![User\_cgc\_at\_mail\_dot](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/u/bbce88/32.png) [@User\_cgc\_at\_mail\_dot](https://forum.ecmwf.int/u/User_cgc_at_mail_dot)\
**Post date:** [25 February 2023 06:07 UTC](https://forum.ecmwf.int/t/how-to-download-surface-pressure-using-cdsapi-from-era5-complete/1491/1 "2023-02-25T06:07:49Z")

</div>

Hi everyone,

I want to download "sp" from ERA5.complete. I have used the request below, but get the code: Expected 4, got 0.; Request failed; Some errors reported (last error -1)

so what is the right requset body?

&nbsp;import cdsapi  
 &nbsp;c = cdsapi.Client()  
 &nbsp;c.retrieve('reanalysis-era5-complete', { # Requests follow MARS syntax  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Keywords 'expver' and 'class' can be dropped. They are obsolete  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # since their values are imposed by 'reanalysis-era5-complete'  
 &nbsp; &nbsp; &nbsp;'date' &nbsp; &nbsp;: '2019-01-01', &nbsp; &nbsp; &nbsp; &nbsp;# The hyphens can be omitted  
 &nbsp; &nbsp; &nbsp;'levelist': '1', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# 1 is top level, 137 the lowest model level in ERA5. Use '/' to separate values.  
 &nbsp; &nbsp; &nbsp;'levtype' : 'ml',  
 &nbsp; &nbsp; &nbsp;'param' &nbsp; : '134', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Full information at [https://apps.ecmwf.int/codes/grib/param-db/](https://apps.ecmwf.int/codes/grib/param-db/)  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # The native representation for temperature is spherical harmonics  
 &nbsp; &nbsp; &nbsp;'stream' &nbsp;: 'oper', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Denotes ERA5. Ensemble members are selected by 'enda'  
 &nbsp; &nbsp; &nbsp;'time' &nbsp; &nbsp;: '00/to/23/by/6', &nbsp; &nbsp; &nbsp; &nbsp; # You can drop :00:00 and use MARS short-hand notation, instead of '00/06/12/18'  
 &nbsp; &nbsp; &nbsp;'type' &nbsp; &nbsp;: 'an',  
 &nbsp; &nbsp; &nbsp;'area' &nbsp; &nbsp;: '60/20/-60/180', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# North, West, South, East. Default: global  
 &nbsp; &nbsp; &nbsp;'grid' &nbsp; &nbsp;: '1/1', &nbsp; &nbsp; &nbsp;# Latitude/longitude. Default: spherical harmonics or reduced Gaussian grid  
 &nbsp; &nbsp; &nbsp;'format' &nbsp;: 'grib', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Output needs to be regular lat-lon, so only works in combination with 'grid'!  
 &nbsp;}, 'ERA5.grib') &nbsp; &nbsp; # Output file. Adapt as you wish.

---

<div class="post-metadata">

**Author:** ![User\_cgc\_at\_mail\_dot](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/u/bbce88/32.png) [@User\_cgc\_at\_mail\_dot](https://forum.ecmwf.int/u/User_cgc_at_mail_dot)\
**Post date:** [25 February 2023 06:27 UTC](https://forum.ecmwf.int/t/how-to-download-surface-pressure-using-cdsapi-from-era5-complete/1491/2 "2023-02-25T06:27:05Z")

</div>

OK, everyone, I have found the solution.

change levtype from "ml" to "sfc".

another question, where can I find the detial of those parameter (levtype......)

---

<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:** [27 February 2023 09:52 UTC](https://forum.ecmwf.int/t/how-to-download-surface-pressure-using-cdsapi-from-era5-complete/1491/3 "2023-02-27T09:52:06Z")

</div>

Hi, You can find full details of the ERA5 dataset at

# [ERA5: data documentation](https://confluence.ecmwf.int/display/CKB/ERA5%3A+data+documentation)

Thanks,

Kevin
