how will i be able to get a single value out of BTC-e API. This is the current API:
As you can see, it shows lots of information. What can i do so that i will only get
--> "last":284.323 <-- this number?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
Well that depends on what language you are using to parse the JSON.
With the BTC-e API JSON response it gives you the category first of "btc_usd" and then within that array is "high", "low", "avg", "last", etc. So in order to only select "last" it would be under btc_usd -> last.
I typically use PHP and it's quite simple to do. Here's a phpfiddle: http://phpfiddle.org/lite/code/jsah-t4dv
<?php $url = "https://btc-e.com/api/3/ticker/btc_usd"; $decode = json_decode(file_get_contents($url), true); $price = $decode["btc_usd"]["last"]; echo $price; ?>