renewedtab icon indicating copy to clipboard operation
renewedtab copied to clipboard

Incorrect ETH To USD conversion

Open ls-milkyway opened this issue 2 years ago • 5 comments

I am not able to get the correct price of ETH To USD ...it is always showing some outrageous value like: 0.000xxx.....also BTC -> USD is not reflecting updated price.

ls-milkyway avatar Mar 29 '22 14:03 ls-milkyway

No response ?????

ls-milkyway avatar Jun 21 '22 01:06 ls-milkyway

Hi, this is a mirror repo so I missed this.

The problem is that the API I'm using is returning bad data. Here's what it's saying the value of 1 USD is in different symbols:

"BTC": "0.0000484389",
"BNB": "197.6991039782",
"DOGE": "0.0544922052",
"ADA": "0.4446395949",
"XRP": "0.2939631553",
"DOT": "7.2880521365",
"ETH": "1023.2444203642"

I'll have to see if there's other API services I can use

rubenwardy avatar Jun 21 '22 16:06 rubenwardy

Hmm, why are u not using free & reliable (with clear & precise API docs) coinmarketcap API ....I am using it flawlessly in google sheets ...with javascript ......but I need the prices on the browser for an instant preview. if u need any assistance...regarding the code or API then let me know.

ls-milkyway avatar Jun 22 '22 01:06 ls-milkyway

Because the widget is added primarily for foreign exchange currencies, not crypto. Crypto came at no extra implementation cost with the API: https://exchangerate.host/

I'll need to switch to a crypto specific data source now, given that that API gives incorrect data

rubenwardy avatar Jun 22 '22 02:06 rubenwardy

I'll need to switch to a crypto specific data source now, given that that API gives incorrect data

It seems customer support at https://exchangerate.host/ is dead or they are lazy to rectify the problem...in any case: FYI:

  1. Although coinmarketcap is reliable & has free plan but it has usage limitations check here
  2. Nomics is another good & reliable option but has 1 request per second limitation (can be handled by the code).
  3. Coinpaparika has 10 request per second.
  4. Messari has: Without an API key, requests are rate limited to 20 requests per minute and 1000 requests per day. Users that create an account will have slightly higher limits of 30 requests per minute and 2000 requests per day. PRO users have the highest limit at 60 requests per minute up to a maximum of 4000 requests per day.

Well, I guess you will need an API with no daily or monthly limitations as request/second can be handled.......further the service should not change their API versions frequently ......also any change in code is PITA as you will have to make changes in your widget code. So I guess Nomics & Coinpaparika are the 2 which u can consider.

ls-milkyway avatar Jun 22 '22 05:06 ls-milkyway