sal0max / currencies

An exchange rates currency converter for Android
GNU General Public License v3.0
222 stars 22 forks source link

Error: Server responded with HTTP 200 #50

Closed cg505 closed 9 months ago

cg505 commented 11 months ago

Getting this confusing error message whenever I use Exchangerate.host. Other providers seem unaffected. Screenshot_20230930-144533 This is 1.20.4 on a Pixel 6a running Android 13. Thanks for taking a look, and apologies if this has already been reported.

sal0max commented 11 months ago

Thanks for reporting this.

Seems like the exchangerate.host API provider sold out and the API was changed without prior notice: https://github.com/Formicka/exchangerate.host/issues/236#issuecomment-1738539199

I will search for alternative free provides, as I can't spend any money on this free project.

In the meantime, please switch to a different API provider in the settings, even though they don't provide the same amount of currencies.

BotBY commented 11 months ago

Hi and thanks for the app! Perhaps in this situation you could allow people to insert their free API key from exchangerate.host?

sal0max commented 11 months ago

Hi and thanks for the app! Perhaps in this situation you could allow people to insert their free API key from exchangerate.host?

@BotBY thanks for the suggestion. I see two issues with that:

Also, the free tier of the new API apparently has some really tough limitations:

I think this API is dead for us.

VasilisKos commented 11 months ago

Unfortunately this was the only provider for Russian rubles exchange rates... 😒 InforEuro gives EU rates which are not real life ones.

sal0max commented 11 months ago

I'm working on this.

Currently, I'm investigation "official" APIs, which hopefully are more stable and keep free. I'm analyzing the data sources of several Central Banks. It looks promising, but it is very time consuming, as every API has a different format and has to be called with different rules.

My private time is very limited, right now, so this could take some days or even weeks, but I promise: I'm on it.

VasilisKos commented 11 months ago

Maybe this is a good source: https://www.floatrates.com/

sal0max commented 11 months ago

Maybe this is a good source: https://www.floatrates.com/

Looks promising. Thanks!

However, some things I noticed:

Can you confirm my issues, @VasilisKos ?

VasilisKos commented 11 months ago

Maybe this is a good source: https://www.floatrates.com/

Looks promising. Thanks!

However, some things I noticed:

  • They don't seem to offer historic rates in JSON format (only XML - not nice but I could work with that)
  • They don't seem to offer a timeline data API (kind of a deal breaker)
  • Maybe not necessary, but I'm not able to create an account on the site. Always getting "Form token validation failed. Please check your data and re-submit it again." error message.

Can you confirm my issues, @VasilisKos ?

  1. Yes. Only xml and html formats.
  2. Yes. Couldn't find anything.
  3. Sorry, but I can't check that. Don't want to give all the personal data they ask for.
s-hutter commented 10 months ago

The central bank of Norway provides an API with about 40 currencies, which is not an amazing number, but still better than what the ECB is offering. Might be a good alternative source?

Daily updates, JSON format, historic data available, free access without API key.

Norges Bank's API for open data offers programmatic access to selected datasets published by the bank. The service is implemented as a REST interface for querying data and metadata and offers a variety of formats for the retrieved data. The service is free to use and requires no authentication.

https://app.norges-bank.no/query/#/en/

aaronwi commented 9 months ago

How many calls a month does this app do? Maybe https://freecurrencyapi.com/ could work, and/or hidden api token entry for advanced users for other services

sal0max commented 9 months ago

How many calls a month does this app do? Maybe https://freecurrencyapi.com/ could work, and/or hidden api token entry for advanced users for other services

As I don't track my users I have no reliable numbers. However, Play Console states, there are around 800 daily users. Based on the feedback on Github, I'd say there are around the same amount of F-Droid users. Let's say about 1500 daily users.

The app itself is very frugal in terms of API calls, as results are cached. But every timeline usage, every historical rate, and of course every daily update has to be a separate API call.

All in all I'd wager, that those 5000 free monthly usages will never ever suffice. Remember: All users would share an API key, as I can't randomly generate one for every new install.


That said, I'm right on the finishing touches of the next update. It will include two new "official" Central Bank data sources. One of them will be Norges Bank, as suggested by @s-hutter. And more are likely to come.

sal0max commented 9 months ago

Unfortunately this was the only provider for Russian rubles exchange rates... 😒 InforEuro gives EU rates which are not real life ones.

Follow-up question on this remark @VasilisKos : Do you know of any providers giving real-world exchange rates to RUB? As Russia is sanctioned in the finance sector by EU and probably also USA and others, it is indeed very hard to determine realistic exchange rates.

E.g.: The last available rate for RUB that's provided by Norges Bank is from 2022-03-01. Since then it's stale: https://app.norges-bank.no/query/index.html#/en/currency?currency=RUB&frequency=B&startdate=2022-03-01&stopdate=2023-11-17

Probably need some source from countries which still do trade with Russia, like China or India.

VasilisKos commented 9 months ago

Unfortunately this was the only provider for Russian rubles exchange rates... 😒 InforEuro gives EU rates which are not real life ones.

Follow-up question on this remark @VasilisKos : Do you know of any providers giving real-world exchange rates to RUB? As Russia is sanctioned in the finance sector by EU and probably also USA and others, it is indeed very hard to determine realistic exchange rates.

E.g.: The last available rate for RUB that's provided by Norges Bank is from 2022-03-01. Since then it's stale: https://app.norges-bank.no/query/index.html#/en/currency?currency=RUB&frequency=B&startdate=2022-03-01&stopdate=2023-11-17

Probably need some source from countries which still do trade with Russia, like China or India.

The Xiaomi Calculator app uses Webull, which is updated every day, and accurate (confirmed). But I don't know about their service, whether it's free or not, APIs etc. You should check it.

sal0max commented 9 months ago

Might the data come directly from the Bank of Russia? https://cbr.ru/eng/currency_base/daily/?UniDbQuery.Posted=True&UniDbQuery.To=18.11.2023

Could you check, @VasilisKos ? I can't easily download the Mi Calculator through the Play Store.

VasilisKos commented 9 months ago

Might the data come directly from the Bank of Russia? https://cbr.ru/eng/currency_base/daily/?UniDbQuery.Posted=True&UniDbQuery.To=18.11.2023

Could you check, @VasilisKos ? I can't easily download the Mi Calculator through the Play Store.

Here's the link: https://play.google.com/store/apps/details?id=com.miui.calculator

No, their data are slightly different, but quite accurate, and reliable I'd say.

sal0max commented 9 months ago

Here's the link: https://play.google.com/store/apps/details?id=com.miui.calculator

Already found it, but not installable on my devices. Probably exclusive to Xiaomi devices.

No, their data are slightly different, but quite accurate, and reliable I'd say.

Thanks for the info. I see if this is something I could provide, then. Haven't found a real XML or JSON API, though. But I keep searching. And their website seems simple enough to maybe do some scraping instead. Will likely be something for the update after the next one, though.

VasilisKos commented 9 months ago

Here's the link: https://play.google.com/store/apps/details?id=com.miui.calculator

Already found it, but not installable on my devices. Probably exclusive to Xiaomi devices.

No, their data are slightly different, but quite accurate, and reliable I'd say.

Thanks for the info. I see if this is something I could provide, then. Haven't found a real XML or JSON API, though. But I keep searching. And their website seems simple enough to maybe do some scraping instead. Will likely be something for the update after the next one, though.

How about this? https://github.com/fawazahmed0/currency-api

keystroke3 commented 9 months ago

I came to echo what @VasilisKos suggested. A quick look at the code shows it is an automatic service that periodically runs a crawls undisclosed websites to find the information. So long as those websites remain operational, I think this is a good alternative for the foreseeable future.

sal0max commented 9 months ago

How about this? https://github.com/fawazahmed0/currency-api

This one doesn't provide timeline data.

(Also, currently the historical rates seem to be broken: https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/2022-11-24/currencies/eur.json - see https://github.com/fawazahmed0/exchange-api/issues/75)

sal0max commented 9 months ago

Incoming of big new release is imminent!

Will remove exchangerate.host and include 3 new APIs:

I'll leave this issue open for now, for feedback from people like @VasilisKos , once they got the chance to try out the new version 1.21.0. 👏

sal0max commented 9 months ago

Release published: https://github.com/sal0max/currencies/releases/tag/1.21.0

Should be live in the Play Store, soon. F-Droid always takes some days.

VasilisKos commented 9 months ago

Release published: https://github.com/sal0max/currencies/releases/tag/1.21.0

Should be live in the Play Store, soon. F-Droid always takes some days.

Works fine! Bravo!

sal0max commented 9 months ago

Thank you, everyone, for your patience.