Bitcoin Forum
June 27, 2024, 04:30:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I need a working PHP mtgox API script [.1 btc]  (Read 753 times)
BitvoinVender (OP)
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
May 22, 2013, 06:40:38 PM
Last edit: May 22, 2013, 07:29:02 PM by BitvoinVender
 #1

Need to be able to withdraw btc and place buy orders.

v1/v2

must be in php


link to my attempts so far,
https://bitcointalk.org/index.php?topic=213284.msg2237716#msg2237716
torba
Member
**
Offline Offline

Activity: 100
Merit: 10



View Profile
May 23, 2013, 01:05:51 AM
 #2

https://github.com/Someguy123/MtGOX-PHP-API
The class is pretty well documented inside the file. Just include the 1 file at the top of your script, then do for example this
Code:
$gox = new Gox('myLongAPIKey', 'Mysecretsecret');
$price = $gox->ticker();

if($price<100){
     $gox->buyBTC($amount, $price, "USD");
}
else {
     $gox->sellBTC($amount, $price, "USD");

}
Whereas $amount and $price actually have to equal something.
See this for more detail on the various functions of the library, it's code is really easy to understand
https://github.com/Someguy123/MtGOX-PHP-API/blob/master/Gox.class.php
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!