From Bitcoin Wiki
Revision as of 09:13, 10 July 2011 by Molecular (talk | contribs) (Websocket API)
Jump to: navigation, search

The MtGox API provides various methods to access different informations from the market, place orders, and more.

Two APIs are available at this point: the HTTP api (available by posting to*) and the websocket API.

Legacy API

This API is available in*, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.


Authentication is performed by posting a username and a password in variables "name" and "pass". Some methods do not require authentication.



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.

Websocket API

See: (will be ported here soon)

You can connect via: ws://

The websocket will subscribe you to some channels automatically:

Channel ID Description
dbf1dee9-4f2e-4a08-8cb7-748919a71b21 trades (each time a trade happens, you get something here)
d5f06780-30a8-4a48-a2f8-7ed181b4a13f the mtgox ticker (lots of updates, with often the same data)
24e67e0d-1cad-4cc0-9e7a-f8523ef460fe depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)