From Bitcoin Wiki
Revision as of 23:55, 23 April 2012 by Neofutur (talk | contribs) (0/redeemBtcPrivkey.php)
Jump to: navigation, search

Version 0 of the HTTP API is available at

HTTP API version 0 methods


This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.


  • since: Passing a tid in "since" allows retrieving all trades since that trade. The passed id is may not exist. Ie. to get all trades from the very beginning one would just call . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since.
  • data is returned in standard json format like :


Get the current Market depth


Get your current balance

getfunds is now deprecated since multi currency, please use info.php


Place an order to Buy BTC

POST data: amount=#&price=#&Currency=PLN

returns a list of your open orders

you can omit the price to do a market order


Place an order to Sell BTC

POST data: &amount=#&price=#&Currency=PLN

returns a list of your open orders

you can omit the price to do a market order


Fetch a list of your open Orders

oid: Order ID

type: 1 for sell order or 2 for buy order

status: 1 for active, 2 for not enough funds


Cancel an order

POST data: oid=#&type=#

oid: Order ID

type: 1 for sell order or 2 for buy order


Used to redeem a mtgox coupon code

  • call with a post parameter "code" containing the code to redeem
  • it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status


used to redeem a private key via the API

  • parameters :

"key":code "keytype":"auto" "description":description


withdraw / Send BTC

POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#

  • pass btca parameter to withdraw to a btc adress
  • pass group1 for a coupon : BTC2CODE or USD2CODE
  • pass group1=DWUSD&dwaccount=XXX-XXX-XXXX (no btca=xxxxxxx) for a dwolla withdraw
  • pass green=1 to use the new greenaddress feature ( see GreenAddress )
  • return code and status if successful
To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )


get a bitcoin deposit adress for your account

  • pass POST data "description" to add a description that will appear in your history when this BTC address receive a deposit
  • pass POST data "ipn" to add an url that mtgox will ping whenever this new address receive funds

description ( see above ) is also required for ipn to work

  • returns a bitcoin deposit address


Allows downloading your activity history for a given currency (BTC or USD for now).

encoding is utf-8


returns info about your account, funds, fees, API privileges, withdraw limits . . .


returns the current ticker :

the time frame for high, low, vol, avg, vwap . . . is sliding 24 hours

what is vwap ?

please see

Examples & Tools

Shell-type CLI

python :

Perl module


https :

module perl :

PHP Dashboard

Bash trade history

bash :

PHP Ticker & BTCGuild mining estimator