Bitcoin Forum
May 04, 2024, 11:25:06 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: sample PHP scripts for getting BTC value  (Read 1104 times)
Justin00 (OP)
Legendary
*
Offline Offline

Activity: 910
Merit: 1000


★YoBit.Net★ 350+ Coins Exchange & Dice


View Profile
November 10, 2013, 03:52:05 AM
 #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

1714821906
Hero Member
*
Offline Offline

Posts: 1714821906

View Profile Personal Message (Offline)

Ignore
1714821906
Reply with quote  #2

1714821906
Report to moderator
1714821906
Hero Member
*
Offline Offline

Posts: 1714821906

View Profile Personal Message (Offline)

Ignore
1714821906
Reply with quote  #2

1714821906
Report to moderator
1714821906
Hero Member
*
Offline Offline

Posts: 1714821906

View Profile Personal Message (Offline)

Ignore
1714821906
Reply with quote  #2

1714821906
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714821906
Hero Member
*
Offline Offline

Posts: 1714821906

View Profile Personal Message (Offline)

Ignore
1714821906
Reply with quote  #2

1714821906
Report to moderator
Bitsky
Hero Member
*****
Offline Offline

Activity: 576
Merit: 514


View Profile
November 10, 2013, 09: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.

Bounty: Earn up to 68.7 BTC
Like my post? Feel free to drop a tip to 1BitskyZbfR4irjyXDaGAM2wYKQknwX36Y
Abdussamad
Legendary
*
Online Online

Activity: 3612
Merit: 1564



View Profile
November 10, 2013, 09: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/
TheButterZone
Legendary
*
Offline Offline

Activity: 3052
Merit: 1031


RIP Mommy


View Profile WWW
November 11, 2013, 12:05:46 AM
 #4

https://github.com/vrotaru/btcticker

Saying that you don't trust someone because of their behavior is completely valid.
btchellas
Newbie
*
Offline Offline

Activity: 35
Merit: 0


View Profile
November 11, 2013, 09:35:34 AM
 #5



thanks
was looking for something like this
Mitchell
Copper Member
Legendary
*
Offline Offline

Activity: 3920
Merit: 2198


Verified awesomeness ✔


View Profile WWW
November 11, 2013, 09: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.

.
Duelbits
            ▄████▄▄
          ▄█████████▄
        ▄█████████████▄
     ▄██████████████████▄
   ▄████▄▄▄█████████▄▄▄███▄
 ▄████▐▀▄▄▀▌████▐▀▄▄▀▌██

 ██████▀▀▀▀███████▀▀▀▀█████

▐████████████■▄▄▄■██████████▀
▐██████████████████████████▀
██████████████████████████▀
▀███████████████████████▀
  ▀███████████████████▀
    ▀███████████████▀
.
         ▄ ▄▄▀▀▀▀▄▄
         ▄▀▀▄      █
         █   ▀▄     █
       ▄█▄     ▀▄   █
      ▄▀ ▀▄      ▀█▀
    ▄▀     ▀█▄▄▄▀▀ ▀
  ▄▀  ▄▀  ▄▀

Live Games

   ▄▄▀▀▀▀▀▀▀▄▄
 ▄▀ ▄▄▀▀▀▀▀▄▄ ▀▄
▄▀ █ ▄  █  ▄ █ ▀▄
█ █   ▀   ▀   █ █  ▄▄▄
█ ▀▀▀▀▀▀▀▀▀▀▀▀▀ █ █   █
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█  █▄█
█ ▀▀█  ▀▀█  ▀▀█ █  █▄█

Slots
.
        ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄
        █         ▄▄  █
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄       █
█  ▄▄         █       █
█             █       █
█   ▄▀▀▄▀▀▄   █       █
█   ▀▄   ▄▀   █       █

Blackjack
|█▀▀▀▀▀█▄▄▄
       ▀████▄▄
         ██████▄
▄▄▄▄▄▄▄▄█▀    ▀▀█
████████▄        █
█████████▄        █
██████████▄     ▄██
█████████▀▀▀█▄▄████
▀▀███▀▀       ████
   █          ███
   █          █▀
▄█████▄▄▄ ▄▄▀▀
███████▀▀▀
.
                 NEW!                  
SPORTS BETTING 
|||
[ Đ ][ Ł ]
AVAILABLE NOW

Advertisements are not endorsed by me.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!