HNT exchange rates are broken

76 Views Asked by At

I would like to obtain the HNT/Helium price via the API. Getting the rates through https://api.coinbase.com/v2/exchange-rates?currency=HNT seems to work like with any other currency, but the rates are completely off.

I noticed that on the website, there actually are two tokens called HNT: Helium and Hento (with Helium definitely being the main one, I had not heard of the other one). However, the rates provided by the API don't correspond to either.

The current results:

API result
0.02013283 = $49.67

HNT - Helium (https://www.coinbase.com/price/helium)
$38.92

HNT - Hinto (https://www.coinbase.com/price/hinto)
$0.0669
2

There are 2 best solutions below

2
genericHCU On

That's pretty awesome. Searching for HINTO on CB comes back with no results but you can get to it directly with the link you provided. Searching for HNT only returns Helium. Yet the API returns the un-searchable results for Hinto when using HNT...

But to answer your question, in case you haven't discovered the solution yet, you can simply change the currency to HELIUM

https://api.coinbase.com/v2/exchange-rates?currency=HELIUM

repsonse:

{"data":{"currency":"HELIUM","rates": [...] {"USD":"30.096511279999998"} [...] }}
0
Taochok On

From a cell, you could call this function:

"colon separated parameters"

=INDEX( SPLIT( INDEX ( SPLIT( IMPORTDATA("https://api.coinbase.com/v2/exchange-rates?currency=HELIUM", "|", ","), ":"), 0, 48), ","), 0, 1)

"semi colon separated parameters"

=INDEX( SPLIT( INDEX ( SPLIT( IMPORTDATA("https://api.coinbase.com/v2/exchange-rates?currency=HELIUM"; "|"; ","); ":"); 0; 48); ","); 0; 1)

This will get you quoted value: "22.87244131153848"

IMPORTDATA will get the JSon, I use the "|" separator so it comes alltogether

{"data":{"currency":"HELIUM","rates":{"AED":"92.539849932...

SPLIT will separate values on every ":"

col 1. {"data"

col 2. {"currency"

col n. ...

INDEX will get the column where the price of Helium is (the FJD is the next element)

"22.87244131153848","FJD"

SPLIT will separate again the value on the ","

col 1: "22.87244131153848"

col 2: "FJD"

INDEX will finally get the resultant value

"22.87244131153848"