NAME

WebService::MtGox - access to mtgox.com's bitcoin trading API

SYNOPSIS

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;

DESCRIPTION

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.

API

Market Information

$m->get_ticker

Get the daily lows and highs along with the current price for btc.

$m->get_depth

Get a list of buyers and sellers.

$m->get_trades

Get a list of recent trades.

Orders

$m->get_balance

Get your balance

$m->buy(amount => $n, price => $p)

Create a buy order.

$m->sell(amount => $n, price => $p)

Create a sell order.

$m->list

List all of your open orders.

$m->cancel(oid => $oid, type => $t)

Cancel an order based on oid and type. Type may be 1 for buy or 2 for sell.

Sending Bitcoins

$m->send(bitcoin_address => $addr, amount => $n)

Use this method to withdraw money from mtgox.

AUTHOR

John BEPPU <beppu {at} cpan.org>

SEE ALSO

API Documentation

https://mtgox.com/support/tradeAPI

Finance::Bitcoin

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.