MtGox/API: Difference between revisions
Jump to navigation
Jump to search
MagicalTux (talk | contribs) Created page with "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 (availabl..." |
MagicalTux (talk | contribs) about websocket API |
||
Line 16: | Line 16: | ||
Parameters: | Parameters: | ||
* 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 https://mtgox.com/code/data/getTrades.php?since=0 . since returns only 100 trades, and you can call the method again by passing the latest trade you have imported in since. | * 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 https://mtgox.com/code/data/getTrades.php?since=0 . 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: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon) |
Revision as of 06:50, 10 July 2011
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 mtgox.com/code/*) and the websocket API.
Legacy API
This API is available in https://mtgox.com/code/*, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.
Authentication
Authentication is performed by posting a username and a password in variables "name" and "pass". Some methods do not require authentication.
Methods
data/getTrades.php
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.
Parameters:
- 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 https://mtgox.com/code/data/getTrades.php?since=0 . 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: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)