# How to set my python script to download data from Dec.2021 to Feb.2022

**URL:** <https://forum.ecmwf.int/t/how-to-set-my-python-script-to-download-data-from-dec-2021-to-feb-2022/7061>\
**Category:** API\
**Tags:** api, era5\
**Created:** [18 October 2024 15:54 UTC](https://forum.ecmwf.int/t/how-to-set-my-python-script-to-download-data-from-dec-2021-to-feb-2022/7061 "2024-10-18T15:54:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiwei\_Dai](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/q/77aa72/32.png) [@Qiwei\_Dai](https://forum.ecmwf.int/u/Qiwei_Dai)\
**Post date:** [18 October 2024 15:54 UTC](https://forum.ecmwf.int/t/how-to-set-my-python-script-to-download-data-from-dec-2021-to-feb-2022/7061/1 "2024-10-18T15:54:17Z")

</div>

Hello everyone

I’m trying to use API to download era5 hourly data on pressure level. I need 10 variables on all pressure levels every 6 hours from Dec.2021 to Feb.2022. How can I set my ‘time’ part of the python script?

---

<div class="post-metadata">

**Author:** ![Gregory\_Greene](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/g/a5b964/32.png) [@Gregory\_Greene](https://forum.ecmwf.int/u/Gregory_Greene)\
**Post date:** [23 October 2024 19:21 UTC](https://forum.ecmwf.int/t/how-to-set-my-python-script-to-download-data-from-dec-2021-to-feb-2022/7061/2 "2024-10-23T19:21:37Z")

</div>

If it’s the same times all the time, something like this:

> import datetime as dt
> 
> times = [dt.time(x).strftime(‘%H:00’) for x in range(0, 24, 6)]

or

> times = [f’{str(x).zfill(2)}:00’ for x in range(0, 24, 6)]

Since it’s so few times, you could just write it manually…

> times = [‘00:00’, ‘06:00’, ‘12:00’, ‘18:00’]

This would be written in your request dictionary as:

> request={  
> &nbsp;&nbsp;&nbsp;&nbsp; ‘time’: times,  
> }

or

> request={  
> &nbsp;&nbsp;&nbsp;&nbsp; ‘time’: [‘00:00’, ‘06:00’, ‘12:00’, ‘18:00’],  
> }
