Author

Topic: sample PHP scripts for getting BTC value (Read 1122 times)

copper member
Activity: 3948
Merit: 2201
Verified awesomeness ✔
November 11, 2013, 04:39:56 AM
#6
I would advice you to use the bitcoinaverage API. Just store the value in your database and update it every, idk, 15 minutes to avoid being blocked. It's easy if you have some coding skills.
newbie
Activity: 35
Merit: 0
legendary
Activity: 3038
Merit: 1032
RIP Mommy
legendary
Activity: 3682
Merit: 1580
November 10, 2013, 04:59:38 AM
#3
hey peoples

anyone have any PHP scripts they use to get the value (I know theirs heaps of diff variables) of BTC in USD from one of the exchanges.. preferably bitcoincharts (unless their is a better one Huh). I'm not all that advanced with PHP but very eager to learn.. I can generally modify something to suit my needs but have trouble getting it going from scratch... I'm pretty sure using json is the answer, but I just cant seem to get it going using the resources i've found searching and my skills (well lack of :/ )

anyways... if anyone could show me a snippet of what they use that would be great.

I've been messing around with this for a bit to long now...

thanks heaps

Each exchange is slightly different but it's basically a case of file_get_contents/curl their API ticker URL and then do a json_decode to get an array that you can simply use. The bitstamp api:

https://www.bitstamp.net/api/
hero member
Activity: 576
Merit: 514
November 10, 2013, 04:27:11 AM
#2
Bitcoincharts has an api you can use. The access is limited, so you shouldn't grab the data each time someone browses your website.
Feel free to PM me if you need code.
legendary
Activity: 910
Merit: 1000
★YoBit.Net★ 350+ Coins Exchange & Dice
November 09, 2013, 10:52:05 PM
#1
hey peoples

anyone have any PHP scripts they use to get the value (I know theirs heaps of diff variables) of BTC in USD from one of the exchanges.. preferably bitcoincharts (unless their is a better one Huh). I'm not all that advanced with PHP but very eager to learn.. I can generally modify something to suit my needs but have trouble getting it going from scratch... I'm pretty sure using json is the answer, but I just cant seem to get it going using the resources i've found searching and my skills (well lack of :/ )

anyways... if anyone could show me a snippet of what they use that would be great.

I've been messing around with this for a bit to long now...

thanks heaps
Jump to: