MtGox/API

From BitcoinWiki
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

The Mt. Gox API provides methods to access information from the market, place orders, and more.

Two APIs are currently available:

Number Formats[edit]

In the "old API", currency- and amount-values (price, volume,...) were given as float. These values are likely being deprecated and replaced by fields of the same name with "_int" as suffix. These are fixed-decimal, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.

In order to convert the int to a decimal you can...

kind of field ...divide by ...multiply by
BTC (volume, amount) 1E8 (100,000,000) 0.00000001
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, NZD, PLN, RUB, SGD, THB, NOK, CZK (price) 1E5 (100,000) 0.00001
JPY, SEK (price) 1E3 (1,000) 0.001

Implementation advice: it's probably best to use int or Decimal (if your language/db offers such a type) in your clients. Using float will likely lead to nasty rounding problems.

Currency Symbols[edit]

List of the currency symbols available with the API:

USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB, NOK, CZK

Bankruptcy; stolen bitcoin (2014–ongoing)[edit]

On 28 February 2014, Mt Gox filed in Tokyo, Japan for bankruptcy protection reporting it had liabilities of about 6.5 billion yen ($65 million USD) and 3.84 billion yen ($38.4 million USD) in assets. [1]

Date and time[edit]

Most dates you will find in mtgox API are UNIX time

See http://en.wikipedia.org/wiki/Unix_time

Most programming languages should have tools for managing those timestamps

See Also on BitcoinWiki[edit]

Source[edit]

http://bitcoin.it/
  1. McLannahan, Ben (2014-02-28). "https://www.ft.com/content/6636e0e8-a06e-11e3-a72c-00144feab7de#axzz2v8w0y2mI" Bitcoin exchange Mt Gox files for bankruptcy protection". Financial Times.