forex-python icon indicating copy to clipboard operation
forex-python copied to clipboard

doesn't return any currency rates after 2023-04-14

Open DanielStroem opened this issue 2 years ago • 3 comments

Whenever I try to get the latest currency rates from the API it only returns the ones from 2023-04-14

DanielStroem avatar Apr 25 '23 06:04 DanielStroem

I temporarily fixed my code to return the latest rates, even though latest in forex python doesn't work properly anymore. If you get today's date from the datetime module you'll get the latest currency rates. Here's an example for how you can get the latest currency rates right now:

#Imports
from forex_python.converter import CurrencyRates
import datetime

#Finds today's date
date=datetime.date.today()

#Gets the latest currency rates based on today's date
currency=CurrencyRates()
value=round(currency.get_rate('USD', 'EUR', date),5)

print(value)

DanielStroem avatar May 04 '23 10:05 DanielStroem

When using the currency.get_rates('EUR', date) one gets a different rate for the USD then when using currency.get_rate('EUR', 'USD', date). Is it possible that the get_rates() function is down whilst the get_rate function still works?

woutervd1 avatar May 05 '23 09:05 woutervd1

When using the currency.get_rates('EUR', date) one gets a different rate for the USD then when using currency.get_rate('EUR', 'USD', date). Is it possible that the get_rates() function is down whilst the get_rate function still works?

Idk seems like my method doesn't work anymore either

DanielStroem avatar May 11 '23 08:05 DanielStroem