exchangerate.host
exchangerate.host copied to clipboard
Receiving incorrect EURO value
When making a request to "https://api.exchangerate.host/latest?base=USD" I get the wrong currency value for EUR.
Here is the code I'm running in a simple Python script.
`import requests import json
res = requests.get("https://api.exchangerate.host/latest?base=USD" rate = res["rates"]["EUR"] print(rate) `
This prints a value of either 0.8811185976821294 or 0.9514041774254622. The second value seems to be valid but the first value is way off. Any ideas?
Seems like the latest USD exchange rates are from 10th January 2022, see "date": "2022-01-10"
https://api.exchangerate.host/2022-04-29?base=USD seems to work fine.
Found a solution: add the current date as the v-parameter: &v=2022-04-29
E.g. https://api.exchangerate.host/latest?base=USD&v=2022-04-29
See https://github.com/Formicka/exchangerate.host/issues/121
Let me try this. Thanks :)
Johannes Kinast @.***> schrieb am Fr., 29. Apr. 2022, 12:43:
Found a solution: add the current date as the v-parameter: &v=2022-04-29
E.g. https://api.exchangerate.host/latest?base=USD&v=2022-04-29
— Reply to this email directly, view it on GitHub https://github.com/Formicka/exchangerate.host/issues/125#issuecomment-1113163069, or unsubscribe https://github.com/notifications/unsubscribe-auth/APV7DGUVKEQOHXZHSMPQI5TVHO4MXANCNFSM5USALIGQ . You are receiving this because you authored the thread.Message ID: @.***>