-->
Page 1 of 1

Get data from API. Bitcoin price from coinmarketcap API

PostPosted: Sat Oct 28, 2017 7:35 pm
by led_builtin
Hello,

I 'd wish someone could indicate how to pull some specific value in a floa variable from a ticker.

I am using nodeMCU in Arduino IDE

Using: https://api.coinmarketcap.com/v1/ticker/bitcoin/ I get:
[
{
"id": "bitcoin",
"name": "Bitcoin",
"symbol": "BTC",
"rank": "1",
"price_usd": "5771.44",
"price_btc": "1.0",
"24h_volume_usd": "1391300000.0",
"market_cap_usd": "96102769559.0",
"available_supply": "16651437.0",
"total_supply": "16651437.0",
"percent_change_1h": "0.46",
"percent_change_24h": "-0.24",
"percent_change_7d": "-4.47",
"last_updated": "1509231251"
}
]

How could a read in a float only the price of bitcoin?

Thank you in advance,

David

Re: Get data from API. Bitcoin price from coinmarketcap API

PostPosted: Thu Nov 02, 2017 3:55 pm
by gdsports
Try the arduino JSON library.

Also see the arduino JSON assistant code generator. Paste some JSON into the input window then see the Arduino source code to parse the JSON data.