'HNT exchange rates are broken
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
Solution 1:[1]
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"} [...] }}
Solution 2:[2]
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"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Dharman |
