WebService::MtGox - access to mtgox.com's bitcoin trading API
Creating the client
use WebService::MtGox; my $m = WebService::MtGox->new( user => 'you', password => 'secret', );
Getting Trade Data
my $ticker = $m->get_ticker; my $depth = $m->get_depth;
Placing Buy and Sell Orders
my $r1 = $m->buy(amount => 24, price => 7.77); my $r2 = $m->sell(amount => 10, price => 8.12);
Make it AnyEvent+Coro-friendly
use WebService::MtGox; use LWP::Protocol::Coro::http;
Finally, use the command line client, mg
mg help mg ticker
WebService::MtGox gives you access to MtGox's bitcoin trading API. With this module, you can get current market data and initiate your buy and sell orders.
It's great for writing bitcoin trading bots.
This constructs a WebService::MtGox object. If user and password are not provided (or are invalid), you will only be able to get market information from the API. You will not be able to buy or sell bitcoins without a valid MtGox username and password.
user
password
The following methods do not require authentication.
Get the daily lows and highs along with the current price in USD for BTC.
Get a list of the current buy and sell orders.
Get a list of recent trades.
The following methods require authentication.
Get your balance
Create a buy order.
Create a sell order.
List all of your open orders.
Cancel an order based on oid and type. Type may be 1 for buy or 2 for sell.
1
2
Use this method to withdraw money from mtgox.
NOTICE: As of 2011-05-30, this API function has not yet been implemented at mtgox.com.
https://mtgox.com/support/tradeAPI
Catalyst::Model::Bitcoin, Finance::Bitcoin, Finance::MtGox
(Had I known about Finance::MtGox, I wouldn't have made this module.)
Buy and sell bitcoins on mtgox.com from the command line.
mg
John BEPPU <beppu {at} cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::MtGox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::MtGox
CPAN shell
perl -MCPAN -e shell install WebService::MtGox
For more information on module installation, please visit the detailed CPAN module installation guide.