Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: andrufala on April 03, 2013, 08:42:27 PM



Title: Help , On my bitcoin website
Post by: andrufala on April 03, 2013, 08:42:27 PM
Hello , I dont know if this goes here but im going to ask

Im not a developer but im trying to get bitcoins charts on my website , and i dont know how , I read that i can call it by JSON but dont know how it work , i was searching for some html code or php but dont found nothing , i see that i could get APIs from major chart websites like blockchain or mtgox but dont know how

could someone explain me ?

thanks


Title: Re: Help , On my bitcoin website
Post by: eric7 on April 04, 2013, 06:28:26 PM
Most (all?) marketplaces have APIs, which allow you to query data that they present in a standard format (JSON).

JSON stands for "javascript object notation", and it's just that-- it's one or more objects in JS with attributes and their corresponding values. There's a great article that explains how to access attributes and why JSON is so useful here: http://www.copterlabs.com/blog/json-what-it-is-how-it-works-how-to-use-it/

Because these APIs all return JSON, you can write JS that runs in the browser and can do things with the data. You can also process JSON server-side of course, but it sounds like you want your charts to appear in the browser. Some APIs you can grab stuff from:

  • http://blockchain.info/api
  • http://bitcoincharts.com/about/markets-api/
  • https://en.bitcoin.it/wiki/MtGox/API
  • https://en.bitcoin.it/wiki/MtGox/API

You can also get JSON of your wallet's data via JSON-RPC, which is pretty awesome IMO: https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)

If you're having a hard time understanding JS, it might be worthwhile to learn the basics of JS here: http://www.w3schools.com/js/

And if you don't want to invest the time and/or energy into working with JS, you can always grab some pre-made charts here: http://bitcoincharts.com/charts/mtgoxUSD#rg60ztgSzm1g10zm2g25zv

The charts are licensed under creative commons. You should double check, but I'm 90% sure you'd be allowed to embed them on your own site without any problems.