Author

Topic: how to display bitcoin's key live data on an HTML webpage [bc.i] (Read 577 times)

sr. member
Activity: 448
Merit: 250
I'm a Web Developer: HTML, CSS, PHP, JS.
You gotta parse it bruh, use php...

Code:

        $ch 
curl_init(); 

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_URL"https://blockchain.info/fr/stats?format=json");

        
$output curl_exec($ch); 

        
curl_close($ch);      

        
$data=json_decode($output,TRUE);

        foreach (
$data as $ratedata) {
                        
$btcprice $ratedata["market_price_usd"];
        }

?>


($btcprice); ?>

I can help you if you want, I work for the experience Tongue...
Add me on skype:michaeladair1996 or message me if you want more help.
legendary
Activity: 1260
Merit: 1002
*noob here

anyone kind enough to explain to me how to display bitcoin live data such as USD price or the global hashrate on an HTML website?
i've been trying to code by myself lately yet i am having trouble fetching data from external sources (such as blockchain.info).
not sure what to use..  Embarrassed

here my current code from the index.html, the price being fixed at 326:

Code:
                            

                                
                                

                        
                                    

                                    
                                        

                                            USD Price
                                        

                                      
                                          

i'm thinking i should use blockchain.info's API ( https://blockchain.info/fr/stats?format=json ) but i am not sure how to do this..

thanks in advance!
Jump to: