MicroPyramid / forex-python

Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io
http://forex-python.readthedocs.io/en/latest/usage.html
MIT License
664 stars 197 forks source link

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

Open DanielStroem opened 1 year ago

DanielStroem commented 1 year ago

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

DanielStroem commented 1 year ago

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)
woutervd1 commented 1 year ago

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?

DanielStroem commented 1 year ago

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