简体   繁体   中英

How to get hourly currency rates in forex-python?

I try to get exchange rates and use forex_python. According to offical documentation I enter date and time. But when I change hour it still returns the same rate. I mean for example rate for 09:00 or 14:00 is the same? How can I change it to get hourly historical currencies? or should I use another API? thank you in advance.

import datetime
from forex_python.converter import CurrencyRates
date_obj=datetime.datetime(2022, 7, 18, 9, 0, 0)
c.convert('USD', 'TRY', 1, date_obj)

Go look at the source. It only uses the date part, not the time. It only stores one price per day.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM