So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By led_builtin
#71321 Hello,

I'd someone could give some indications about how to pull some data form an API getting an float variable with it.

I am using an ESP 01 and NodeMCU with Arduino IDE

In this case I want some specific values from Coinmarketcap API related to the value of Bitcoin.

With: 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"
}
]

What should I do to get in a float its value in USD? In that case 5771.44

Thank you in advance,


David