How to parse Json data from remote server?

0 votes

I want to extract data from a website (https://btc-e.com/api/2/btc_usd/ticker ) and then use the value got from this for my further tasks and function. Is there a way I can do it?

Aug 17, 2018 in Blockchain by slayer
• 29,170 points
44 views

1 answer to this question.

0 votes

Yes, you can do it use the following code:

<?php

$content=file_get_contents("https://btc-e.com/api/2/btc_usd/ticker");

$data=json_decode($content);

//The values are stored in $data. Now you can use them for your functions

?>
answered Aug 17, 2018 by digger
• 26,550 points

Related Questions In Blockchain

0 votes
1 answer

How to retrieve data from a block to a blockchain?

web3.eth.getTransaction(txHash) will returns transaction details like blockHash, transactionIndex, ...READ MORE

answered Jun 26, 2018 in Blockchain by Perry
• 17,020 points
229 views
0 votes
1 answer
0 votes
1 answer

How to retrieve data from an Ethereum Block?

To get transaction details like Block Hash ...READ MORE

answered Jul 19, 2018 in Blockchain by Perry
• 17,020 points
52 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
169 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,550 points
4,279 views
0 votes
1 answer
0 votes
1 answer

Python Script to pull data from Blockchain JSON

Try this: print r.json()['address'],' has ', r.json()['n_tx'], 'tra ...READ MORE

answered Sep 14, 2018 in Blockchain by digger
• 26,550 points
289 views
0 votes
1 answer