<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Molecular</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Molecular"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Molecular"/>
	<updated>2026-04-18T02:54:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=21995</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=21995"/>
		<updated>2012-01-10T22:24:25Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides methods to access information from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are currently available: the HTTP API (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
==Number Formats==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;old API&amp;quot;, currency- and amount-values (price, volume,...) were given as &#039;&#039;&#039;float&#039;&#039;&#039;. These values are likely being deprecated and replaced by fields of the same name with &amp;quot;_int&amp;quot; as suffix. These are &#039;&#039;&#039;fixed-decimal&#039;&#039;&#039;, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.&lt;br /&gt;
&lt;br /&gt;
In order to convert the &#039;&#039;&#039;int&#039;&#039;&#039; to a &#039;&#039;&#039;decimal&#039;&#039;&#039; you can...&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! kind of field !! ...divide by !! ...multiply by&lt;br /&gt;
|-&lt;br /&gt;
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001&lt;br /&gt;
|-&lt;br /&gt;
| USD (price) || 1E5 (100,000) || 0.00001&lt;br /&gt;
|-&lt;br /&gt;
| JPY (price) || 1E3 (1,000) || 0.001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Implementation advice: it&#039;s probably best to use &#039;&#039;&#039;int&#039;&#039;&#039; or &#039;&#039;&#039;Decimal&#039;&#039;&#039; (if your language/db offers such a type) in your clients. Using &#039;&#039;&#039;float&#039;&#039;&#039; will likely lead to nasty rounding problems.&lt;br /&gt;
&lt;br /&gt;
== Currency Symbols ==&lt;br /&gt;
List of the currency symbols available with the API:&lt;br /&gt;
&lt;br /&gt;
USD, AUD, CAD, CHF, CNY, DKK, EUR, GBP, HKD, JPY, NZD, PLN, RUB, SEK, SGD, THB&lt;br /&gt;
&lt;br /&gt;
== HTTP API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/api/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.  There is also a [https://rubygems.org/gems/mtgox Ruby gem] and [[Finance::MtGox|Perl module]] for interacting with the HTTP API.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Authentication is performed by signing each request using HMAC-SHA512. The request must contain an extra value &amp;quot;nonce&amp;quot; which must be an always incrementing numeric value.  A reference implementation is provided here:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
function mtgox_query($path, array $req = array()) {&lt;br /&gt;
	// API settings&lt;br /&gt;
	$key = &#039;&#039;;&lt;br /&gt;
	$secret = &#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
	// generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems&lt;br /&gt;
	$mt = explode(&#039; &#039;, microtime());&lt;br /&gt;
	$req[&#039;nonce&#039;] = $mt[1].substr($mt[0], 2, 6);&lt;br /&gt;
&lt;br /&gt;
	// generate the POST data string&lt;br /&gt;
	$post_data = http_build_query($req, &#039;&#039;, &#039;&amp;amp;&#039;);&lt;br /&gt;
&lt;br /&gt;
	// generate the extra headers&lt;br /&gt;
	$headers = array(&lt;br /&gt;
		&#039;Rest-Key: &#039;.$key,&lt;br /&gt;
		&#039;Rest-Sign: &#039;.base64_encode(hash_hmac(&#039;sha512&#039;, $post_data, base64_decode($secret), true)),&lt;br /&gt;
	);&lt;br /&gt;
&lt;br /&gt;
	// our curl handle (initialize if required)&lt;br /&gt;
	static $ch = null;&lt;br /&gt;
	if (is_null($ch)) {&lt;br /&gt;
		$ch = curl_init();&lt;br /&gt;
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;br /&gt;
		curl_setopt($ch, CURLOPT_USERAGENT, &#039;Mozilla/4.0 (compatible; MtGox PHP client; &#039;.php_uname(&#039;s&#039;).&#039;; PHP/&#039;.phpversion().&#039;)&#039;);&lt;br /&gt;
	}&lt;br /&gt;
	curl_setopt($ch, CURLOPT_URL, &#039;https://mtgox.com/api/&#039;.$path);&lt;br /&gt;
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);&lt;br /&gt;
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);&lt;br /&gt;
&lt;br /&gt;
	// run the query&lt;br /&gt;
	$res = curl_exec($ch);&lt;br /&gt;
	if ($res === false) throw new Exception(&#039;Could not get reply: &#039;.curl_error($ch));&lt;br /&gt;
	$dec = json_decode($res, true);&lt;br /&gt;
	if (!$dec) throw new Exception(&#039;Invalid data received, please make sure connection is working and requested API exists&#039;);&lt;br /&gt;
	return $dec;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// example 1: get infos about the account, plus the list of rights we have access to&lt;br /&gt;
var_dump(mtgox_query(&#039;0/info.php&#039;));&lt;br /&gt;
&lt;br /&gt;
// old api (get funds)&lt;br /&gt;
var_dump(mtgox_query(&#039;0/getFunds.php&#039;));&lt;br /&gt;
&lt;br /&gt;
// trade example&lt;br /&gt;
// var_dump(mtgox_query(&#039;0/buyBTC.php&#039;, array(&#039;amount&#039; =&amp;gt; 1, &#039;price&#039; =&amp;gt; 15)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Python version here: https://bitcointalk.org/index.php?topic=49789.msg592388#msg592388&lt;br /&gt;
&lt;br /&gt;
=== Cache ===&lt;br /&gt;
&lt;br /&gt;
All of the API methods below have cached results, ticker, depth . . . have a 10 seconds cache .&lt;br /&gt;
No need to poll more often, you wont have more results, you could just be blocked by the prolexic anti ddos features.&lt;br /&gt;
&lt;br /&gt;
=== Methods API version 0===&lt;br /&gt;
&lt;br /&gt;
==== 0/data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
* data is returned in standard json format like :&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
[&lt;br /&gt;
{&amp;quot;date&amp;quot;:1279408157,&lt;br /&gt;
&amp;quot;price&amp;quot;:&amp;quot;0.04951&amp;quot;,&lt;br /&gt;
&amp;quot;amount&amp;quot;:&amp;quot;20&amp;quot;,&lt;br /&gt;
&amp;quot;price_int&amp;quot;:&amp;quot;4951&amp;quot;,&lt;br /&gt;
&amp;quot;amount_int&amp;quot;:&amp;quot;2000000000&amp;quot;,&lt;br /&gt;
&amp;quot;tid&amp;quot;:&amp;quot;1&amp;quot;,&lt;br /&gt;
&amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
&amp;quot;trade_type&amp;quot;:&amp;quot;&amp;quot;&lt;br /&gt;
&amp;quot;primary&amp;quot;:&amp;quot;Y&amp;quot;&lt;br /&gt;
},&lt;br /&gt;
{&amp;quot;date&amp;quot;:1279424586,&amp;quot;price&amp;quot;:&amp;quot;0.05941&amp;quot;,&amp;quot;amount&amp;quot;:&amp;quot;50.01&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;5941&amp;quot;,&amp;quot;amount_int&amp;quot;:&amp;quot;5001000000&amp;quot;,&amp;quot;tid&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;trade_type&amp;quot;:&amp;quot;&amp;quot;}]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 0/getDepth.php ====&lt;br /&gt;
Get the current Market depth&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/data/getDepth.php?Currency=PLN&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/data/getDepth.php?Currency=AUD&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/data/getDepth.php?Currency=USD&lt;br /&gt;
&lt;br /&gt;
==== 0/getFunds.php ====&lt;br /&gt;
Get your current balance&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/getFunds.php&lt;br /&gt;
&lt;br /&gt;
getfunds is now deprecated since multi currency, please use info.php&lt;br /&gt;
&lt;br /&gt;
==== 0/buyBTC.php ====&lt;br /&gt;
Place an order to Buy BTC&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/buyBTC.php&lt;br /&gt;
&lt;br /&gt;
POST data: amount=#&amp;amp;price=#&amp;amp;Currency=PLN&lt;br /&gt;
&lt;br /&gt;
returns a list of your open orders&lt;br /&gt;
&lt;br /&gt;
you can omit the price to do a market order&lt;br /&gt;
&lt;br /&gt;
==== 0/sellBTC.php ====&lt;br /&gt;
Place an order to Sell BTC&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/sellBTC.php&lt;br /&gt;
&lt;br /&gt;
POST data: &amp;amp;amount=#&amp;amp;price=#&amp;amp;Currency=PLN &lt;br /&gt;
&lt;br /&gt;
returns a list of your open orders&lt;br /&gt;
&lt;br /&gt;
you can omit the price to do a market order&lt;br /&gt;
&lt;br /&gt;
==== 0/getOrders.php ====&lt;br /&gt;
Fetch a list of your open Orders&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/getOrders.php&lt;br /&gt;
&lt;br /&gt;
oid: Order ID&lt;br /&gt;
&lt;br /&gt;
type: 1 for sell order or 2 for buy order&lt;br /&gt;
&lt;br /&gt;
status: 1 for active, 2 for not enough funds&lt;br /&gt;
&lt;br /&gt;
==== 0/cancelOrder.php ====&lt;br /&gt;
Cancel an order&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/cancelOrder.php&lt;br /&gt;
&lt;br /&gt;
POST data: oid=#&amp;amp;type=#&lt;br /&gt;
&lt;br /&gt;
oid: Order ID&lt;br /&gt;
&lt;br /&gt;
type: 1 for sell order or 2 for buy order&lt;br /&gt;
&lt;br /&gt;
==== 0/redeemCode.php ====&lt;br /&gt;
Used to redeem a mtgox coupon code&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/redeemCode.php&lt;br /&gt;
&lt;br /&gt;
* call with a post parameter &amp;quot;code&amp;quot; containing the code to redeem&lt;br /&gt;
&lt;br /&gt;
* it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status&lt;br /&gt;
&lt;br /&gt;
==== 0/withdraw.php ====&lt;br /&gt;
withdraw / Send BTC&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/withdraw.php&lt;br /&gt;
&lt;br /&gt;
POST data: group1=BTC&amp;amp;btca=bitcoin_address_to_send_to&amp;amp;amount=#&lt;br /&gt;
&lt;br /&gt;
* pass btca parameter to withdraw to a btc adress&lt;br /&gt;
&lt;br /&gt;
* pass group1 for a coupon : BTC2CODE or USD2CODE&lt;br /&gt;
&lt;br /&gt;
* pass group1=DWUSD&amp;amp;dwaccount=XXX-XXX-XXXX (no btca=xxxxxxx) for a dwolla withdraw&lt;br /&gt;
&lt;br /&gt;
* pass green=1 to use the new greenaddress feature ( see [[GreenAddress]] )&lt;br /&gt;
* return code and status if successful&lt;br /&gt;
&lt;br /&gt;
 To make a withdraw in another Currency , use group1=USD2CODE and add a Currency parameter ( example Currency=EUR to get a mtgox EUR coupon )&lt;br /&gt;
&lt;br /&gt;
==== 0/btcAddress.php ====&lt;br /&gt;
get a bitcoin deposit adress for your account &lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/btcAddress.php&lt;br /&gt;
&lt;br /&gt;
* pass POST data &amp;quot;description&amp;quot; to add a description that will appear in your history when this BTC address receive a deposit&lt;br /&gt;
&lt;br /&gt;
* returns a bitcoin deposit address&lt;br /&gt;
&lt;br /&gt;
==== 0/history_[CUR].csv ====&lt;br /&gt;
&lt;br /&gt;
Allows downloading your activity history for a given currency (BTC or USD for now).&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/history_BTC.csv&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/history_USD.csv&lt;br /&gt;
&lt;br /&gt;
==== 0/info.php ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/0/info.php&lt;br /&gt;
&lt;br /&gt;
returns info about your account, funds, fees, API privileges, withdraw limits . . . &lt;br /&gt;
&lt;br /&gt;
==== 0/ticker ====&lt;br /&gt;
&lt;br /&gt;
http://mtgox.com/api/0/data/ticker.php&lt;br /&gt;
&lt;br /&gt;
returns the current ticker :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{&amp;quot;ticker&amp;quot;:&lt;br /&gt;
 {&lt;br /&gt;
 &amp;quot;high&amp;quot;:5.70653,&lt;br /&gt;
 &amp;quot;low&amp;quot;:5.4145,&lt;br /&gt;
 &amp;quot;avg&amp;quot;:5.561388723,&lt;br /&gt;
 &amp;quot;vwap&amp;quot;:5.610932845,&lt;br /&gt;
 &amp;quot;vol&amp;quot;:55698,&lt;br /&gt;
 &amp;quot;last&amp;quot;:5.56915,&lt;br /&gt;
 &amp;quot;buy&amp;quot;:5.51326,&lt;br /&gt;
 &amp;quot;sell&amp;quot;:5.5672&lt;br /&gt;
 }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 the time frame for high, low, vol, avg, vwap . . . is sliding 24 hours&lt;br /&gt;
&lt;br /&gt;
what is vwap ? &lt;br /&gt;
&lt;br /&gt;
please see http://en.wikipedia.org/wiki/VWAP&lt;br /&gt;
&lt;br /&gt;
=== API version 0 examples ===&lt;br /&gt;
&lt;br /&gt;
==== all api shell type CLI ====&lt;br /&gt;
&lt;br /&gt;
python : http://www.goxsh.info/&lt;br /&gt;
&lt;br /&gt;
perl : http://pastebin.com/vEpgw5nW&lt;br /&gt;
&lt;br /&gt;
==== other ====&lt;br /&gt;
&lt;br /&gt;
https : http://stackoverflow.com/questions/7046370/https-request-with-boost-asio-and-openssl&lt;br /&gt;
&lt;br /&gt;
https://github.com/sje397/mtgox-plasmoid&lt;br /&gt;
&lt;br /&gt;
module perl : http://search.cpan.org/~mndrix/Finance-MtGox-0.02/&lt;br /&gt;
&lt;br /&gt;
==== gather data ====&lt;br /&gt;
&lt;br /&gt;
https://github.com/Lexiks/MyBitBoard&lt;br /&gt;
&lt;br /&gt;
==== gettrade ====&lt;br /&gt;
&lt;br /&gt;
bash : https://bitcointalk.org/index.php?topic=39402.0&lt;br /&gt;
&lt;br /&gt;
perl : http://pastebin.com/raw.php?i=pmhMXZJu&lt;br /&gt;
&lt;br /&gt;
==== ticker ====&lt;br /&gt;
&lt;br /&gt;
http://pastebin.com/pd0ZR4WY&lt;br /&gt;
&lt;br /&gt;
=== Methods API version 1===&lt;br /&gt;
&lt;br /&gt;
==== Multi Currency Ticker ====&lt;br /&gt;
&lt;br /&gt;
 https://mtgox.com/api/1/BTCUSD/public/ticker&lt;br /&gt;
 https://mtgox.com/api/1/BTCEUR/public/ticker&lt;br /&gt;
&lt;br /&gt;
 returns the current ticker for the selected currency :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
&amp;quot;result&amp;quot;:&amp;quot;success&amp;quot;,&lt;br /&gt;
&amp;quot;return&amp;quot;:&lt;br /&gt;
 {&lt;br /&gt;
 &amp;quot;high&amp;quot;: {&amp;quot;value&amp;quot;:&amp;quot;5.70653&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;570653&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.70653&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;low&amp;quot;: {&amp;quot;value&amp;quot;:&amp;quot;5.4145&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;541450&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.41450&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;avg&amp;quot;: {&amp;quot;value&amp;quot;:&amp;quot;5.561119626&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;556112&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.56112&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;vwap&amp;quot;: {&amp;quot;value&amp;quot;:&amp;quot;5.610480461&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;561048&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.61048&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;vol&amp;quot;:&lt;br /&gt;
 {&lt;br /&gt;
  &amp;quot;value&amp;quot;:&amp;quot;55829.58960346&amp;quot;,&lt;br /&gt;
  &amp;quot;value_int&amp;quot;:&amp;quot;5582958960346&amp;quot;,&lt;br /&gt;
  &amp;quot;display&amp;quot;:&amp;quot;55,829.58960346\u00a0BTC&amp;quot;,&lt;br /&gt;
  &amp;quot;currency&amp;quot;:&amp;quot;BTC&amp;quot;&lt;br /&gt;
 },&lt;br /&gt;
 &amp;quot;last_local&amp;quot;:{&amp;quot;value&amp;quot;:&amp;quot;5.5594&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;555940&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.55940&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;last_orig&amp;quot;:{&amp;quot;value&amp;quot;:&amp;quot;5.5594&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;555940&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.55940&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;last&amp;quot;:{&amp;quot;value&amp;quot;:&amp;quot;5.5594&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;555940&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.55940&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;buy&amp;quot;:{&amp;quot;value&amp;quot;:&amp;quot;5.53587&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;553587&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.53587&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;},&lt;br /&gt;
 &amp;quot;sell&amp;quot;:{&amp;quot;value&amp;quot;:&amp;quot;5.56031&amp;quot;,&amp;quot;value_int&amp;quot;:&amp;quot;556031&amp;quot;,&amp;quot;display&amp;quot;:&amp;quot;$5.56031&amp;quot;,&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;}&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
note : last_local include only the last trade in the selected currency, last_orig include data of the original last trade ( currency,price in currency . . . ),last can be a conversion of the last trde in another currency&lt;br /&gt;
&lt;br /&gt;
==== Multi Currency depth ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCPLN/public/depth?raw&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCAUD/public/depth?raw&lt;br /&gt;
&lt;br /&gt;
==== Multi currency trades ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCPLN/public/trades?raw&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCAUD/public/trades?raw&lt;br /&gt;
&lt;br /&gt;
to get only the trades since a given trade id, you can add the parameter since=&amp;lt;trade_id&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCUSD/public/trades?since=0&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCEUR/public/trades?since=1316312781670700&lt;br /&gt;
&lt;br /&gt;
For multi currency,also returns the primary value,&amp;quot;Y&amp;quot; or &amp;quot;N&amp;quot;, the primary currency is always the buyers currency&lt;br /&gt;
&lt;br /&gt;
A trade can appear in more than one currency, to ignore duplicates, use only the trades having primary =Y&lt;br /&gt;
&lt;br /&gt;
example of returned data : &lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{&amp;quot;date&amp;quot;:1316312781,&lt;br /&gt;
&amp;quot;price&amp;quot;:&amp;quot;3.5599&amp;quot;,&lt;br /&gt;
&amp;quot;amount&amp;quot;:&amp;quot;3.6900096&amp;quot;,&lt;br /&gt;
&amp;quot;price_int&amp;quot;:&amp;quot;355990&amp;quot;,&lt;br /&gt;
&amp;quot;amount_int&amp;quot;:&amp;quot;369000960&amp;quot;,&lt;br /&gt;
&amp;quot;tid&amp;quot;:&amp;quot;1316312781670700&amp;quot;,&lt;br /&gt;
&amp;quot;price_currency&amp;quot;:&amp;quot;EUR&amp;quot;,&lt;br /&gt;
&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
&amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
&amp;quot;primary&amp;quot;:&amp;quot;Y&amp;quot;,&lt;br /&gt;
&amp;quot;properties&amp;quot;:&amp;quot;limit,mixed_currency&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Cancelled Trades ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCUSD/public/cancelledtrades&lt;br /&gt;
&lt;br /&gt;
returns a list of all the cancelled trades this last month, list of trade ids in json format .&lt;br /&gt;
&lt;br /&gt;
==== Full Depth ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCUSD/public/fulldepth&lt;br /&gt;
&lt;br /&gt;
returns full depth&lt;br /&gt;
&lt;br /&gt;
==== Private info ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/generic/private/info&lt;br /&gt;
&lt;br /&gt;
returns information about your account, funds, fees, API privileges, withdraw limits . . .&lt;br /&gt;
&lt;br /&gt;
==== Your open orders ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/generic/private/orders&lt;br /&gt;
 &lt;br /&gt;
returns information about your current open orders&lt;br /&gt;
&lt;br /&gt;
==== Submit an order ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/BTCUSD/private/order/add&lt;br /&gt;
&lt;br /&gt;
parameters: &lt;br /&gt;
* type (bid|ask)&lt;br /&gt;
* amount_int &amp;lt;amount as int&amp;gt;&lt;br /&gt;
* price_int &amp;lt;price as int&amp;gt; (can be omitted to place market order)&lt;br /&gt;
 &lt;br /&gt;
submits an order and returns info about success or error&lt;br /&gt;
&lt;br /&gt;
==== Currency information ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/generic/public/currency&lt;br /&gt;
&lt;br /&gt;
pass parameter ?currency=&amp;lt;currency_symbol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns information about a currency ( number of decimals . . . )&lt;br /&gt;
&lt;br /&gt;
==== HOTP key ====&lt;br /&gt;
&lt;br /&gt;
https://mtgox.com/api/1/generic/public/hotp_gen&lt;br /&gt;
&lt;br /&gt;
used to generate a new HOTP key ( useful for developpers )&lt;br /&gt;
&lt;br /&gt;
== Streaming API ==&lt;br /&gt;
Real time streaming data may be obtained over the streaming API, implemented in [http://socket.io/ Socket.io]&amp;lt;ref&amp;gt;Socket.io forum announcement by MagicalTux: https://bitcointalk.org/index.php?topic=14412.msg613271#msg613271&amp;lt;/ref&amp;gt;. The original WebSocket API&amp;lt;ref&amp;gt;Original WebSocket thread: https://bitcointalk.org/index.php?topic=5855.msg86219&amp;lt;/ref&amp;gt; is deprecated as of 11-Nov-2011.&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
The following JavaScript code establishes a connection in the browser:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script src=&amp;quot;https://socketio.mtgox.com/socket.io/socket.io.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    var conn = io.connect(&#039;https://socketio.mtgox.com/mtgox&#039;);&lt;br /&gt;
    conn.on(&#039;message&#039;, function(data) {&lt;br /&gt;
        // Handle incoming data object.&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The session ID expires after 30 seconds&lt;br /&gt;
&lt;br /&gt;
===Handling Events===&lt;br /&gt;
Socket.io exposes a simple interface for handling events. Handling &amp;lt;tt&amp;gt;message&amp;lt;/tt&amp;gt; events is shown above, but there are other events that may be handled:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
conn.on(&#039;connect&#039;,    onConnect);&lt;br /&gt;
conn.on(&#039;disconnect&#039;, onDisconnect);&lt;br /&gt;
conn.on(&#039;error&#039;,      onError);&lt;br /&gt;
conn.on(&#039;message&#039;,    onMessage);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
Data arrives as a full object instead of as JSON text, eliminating the need to parse the data in the JavaScript handler. Messages that come across the socket to trigger the &amp;lt;tt&amp;gt;message&amp;lt;/tt&amp;gt; event will contain the following minimum components:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;lt;OPERATION_TYPE&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;OPERATION_TYPE&amp;lt;/tt&amp;gt; field may take these values:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! OPERATION_TYPE !! Description&lt;br /&gt;
|-&lt;br /&gt;
| subscribe || Notification that the user is subscribed to a channel&lt;br /&gt;
|-&lt;br /&gt;
| unsubscribe || Messages will no longer arrive over the channel&lt;br /&gt;
|-&lt;br /&gt;
| remark || A server message, usually a warning&lt;br /&gt;
|-&lt;br /&gt;
| private || The operation for depth, trade, and ticker messages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===op:subscribe and op:unsubscribe===&lt;br /&gt;
The subscribe and unsubscribe message data are very simple, containing the channel and the operation.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;lt;CHANNEL_ID&amp;gt;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;subscribe&amp;quot; OR &amp;quot;unsubscribe&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the channels are:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || Trades&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || Ticker&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || Depth&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===op:remark===&lt;br /&gt;
The remark operation contains message and success fields.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;remark&amp;quot;,&lt;br /&gt;
  &amp;quot;message&amp;quot;:&amp;lt;MESSAGE FROM THE SERVER&amp;gt;,&lt;br /&gt;
  &amp;quot;success&amp;quot;:&amp;lt;boolean&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===op:private===&lt;br /&gt;
The payloads of the &amp;lt;tt&amp;gt;op:private&amp;lt;/tt&amp;gt; messages contain the real time market information. Each message follows this form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;lt;CHANNEL_ID&amp;gt;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;lt;MESSAGE_TYPE&amp;gt;,&lt;br /&gt;
  &amp;lt;MESSAGE_TYPE&amp;gt;:&amp;lt;DATA_PAYLOAD&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;MESSAGE_TYPE&amp;lt;/tt&amp;gt; field may take the values:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! MESSAGE_TYPE !! Description&lt;br /&gt;
|-&lt;br /&gt;
| ticker || Ticker messages&lt;br /&gt;
|-&lt;br /&gt;
| trade || Trades, as they occur&lt;br /&gt;
|-&lt;br /&gt;
| depth || Orders placed or removed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
Ticker messages contain the current inside Bid and Ask as well as daily highs, lows, and volume. The fields contained in the ticker match those defined in the version 1.0 API above. All fields contain &amp;lt;tt&amp;gt;currency&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;display&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;value_int&amp;lt;/tt&amp;gt; entries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-7ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;avg&amp;quot;:{&lt;br /&gt;
      &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
      &amp;quot;display&amp;quot;:&amp;quot;$2.26847&amp;quot;,&lt;br /&gt;
      &amp;quot;value&amp;quot;:&amp;quot;2.26847&amp;quot;,&lt;br /&gt;
      &amp;quot;value_int&amp;quot;:&amp;quot;226847&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;buy&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;high&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;last&amp;quot;:{..},&lt;br /&gt;
    &amp;quot;last_local&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;last_orig&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;low&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;sell&amp;quot;:{...},&lt;br /&gt;
    &amp;quot;vol&amp;quot;:{&lt;br /&gt;
      &amp;quot;currency&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
      &amp;quot;display&amp;quot;:&amp;quot;118,696.02104208&amp;quot;,&lt;br /&gt;
      &amp;quot;value&amp;quot;:&amp;quot;118696.02104208&amp;quot;,&lt;br /&gt;
      &amp;quot;value_int&amp;quot;:&amp;quot;11869602104208&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    &amp;quot;vwap&amp;quot;:{...}&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;primary&amp;quot;:&amp;quot;Y&amp;quot;,&lt;br /&gt;
    &amp;quot;properties&amp;quot;:&amp;quot;limit, mixed_currency&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;now&amp;quot;:&amp;quot;1323644358437819&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;total_volume_int&amp;quot;:&amp;quot;849766000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
=== examples ===&lt;br /&gt;
&lt;br /&gt;
==== ticker ====&lt;br /&gt;
javascript, using hookio : &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=KD5ljtNK72U&lt;br /&gt;
&lt;br /&gt;
http://github.com/hookio&lt;br /&gt;
&lt;br /&gt;
http://github.com/cronopio/hook.io-mtgox&lt;br /&gt;
&lt;br /&gt;
Another node.js project, using plain websockets (largely based on cronopio&#039;s work) :&lt;br /&gt;
&lt;br /&gt;
https://github.com/dlanod/node-mtgox-websocket-client&lt;br /&gt;
&lt;br /&gt;
==== arbitrage ====&lt;br /&gt;
https://github.com/goteppo/ArBit&lt;br /&gt;
&lt;br /&gt;
==== websocket ====&lt;br /&gt;
https://github.com/cronopio/hook.io-ws&lt;br /&gt;
&lt;br /&gt;
https://github.com/dlanod/node-mtgox-websocket-client&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12783</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12783"/>
		<updated>2011-07-10T10:31:37Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
==Number Formats==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;old API&amp;quot;, currency- and amount-values (price, volume,...) where given as &#039;&#039;&#039;float&#039;&#039;&#039;. These values are likely being deprecated and replaced by fields of the same name with &amp;quot;_int&amp;quot; as postfix. These are &#039;&#039;&#039;fixed-decimal&#039;&#039;&#039;, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.&lt;br /&gt;
&lt;br /&gt;
In order to convert the &#039;&#039;&#039;int&#039;&#039;&#039; to a &#039;&#039;&#039;decimal&#039;&#039;&#039; you can...&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! kind of field !! ...divide by !! ...multiply by&lt;br /&gt;
|-&lt;br /&gt;
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001&lt;br /&gt;
|-&lt;br /&gt;
| USD (price) || 1E5 (100,000) || 0.00001&lt;br /&gt;
|-&lt;br /&gt;
| JPY (price) || 1E3 (1,000) || 0.001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Implementation advice: it&#039;s probably best to use &#039;&#039;&#039;int&#039;&#039;&#039; or &#039;&#039;&#039;Decimal&#039;&#039;&#039; (if your language/db offers such a type) in your clients. Using &#039;&#039;&#039;float&#039;&#039;&#039; will likely lead to nasty rounding problems.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12782</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12782"/>
		<updated>2011-07-10T10:30:54Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Number Formats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
==Number Formats==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;old API&amp;quot;, currency- and amount-values (price, volume,...) where given as &#039;&#039;&#039;float&#039;&#039;&#039;. These values are likely being deprecated and replaced by fields of the same name with &amp;quot;_int&amp;quot; as postfix. These are &#039;&#039;&#039;fixed-decimal&#039;&#039;&#039;, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value.&lt;br /&gt;
&lt;br /&gt;
In order to convert the &#039;&#039;&#039;int&#039;&#039;&#039; to a &#039;&#039;&#039;decimal&#039;&#039;&#039; you can...&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! kind of field !! ...divide by !! ...multiply by&lt;br /&gt;
|-&lt;br /&gt;
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001&lt;br /&gt;
|-&lt;br /&gt;
| USD (price) || 1E5 (100,000) || 0.00001&lt;br /&gt;
|-&lt;br /&gt;
| JPY (price) || 1E3 (1,000) || 0.001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Implementation advice: it&#039;s probably best to use &#039;&#039;&#039;int&#039;&#039;&#039; or &#039;&#039;&#039;Decimal&#039;&#039;&#039; (if your language/db offers such a type) in your clients. Using &#039;&#039;&#039;float&#039;&#039;&#039; will likely lead to nasty rounding problems.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12780</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12780"/>
		<updated>2011-07-10T10:22:16Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
==Number Formats==&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;old API&amp;quot;, currency- and amount-values (price, volume,...) where given as &#039;&#039;&#039;float&#039;&#039;&#039;. These values are likely being deprecated and replaced by fields of the same name with &amp;quot;_int&amp;quot; as postfix. These are &#039;&#039;&#039;fixed-decimal&#039;&#039;&#039;, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Kind of Field !! divide by !! Smallest possible value&lt;br /&gt;
|-&lt;br /&gt;
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001&lt;br /&gt;
|-&lt;br /&gt;
| USD (price) || 1E5 (100,000) || 0.00001&lt;br /&gt;
|-&lt;br /&gt;
| JPY (price) || 1E3 (1,000) || 0.001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12779</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12779"/>
		<updated>2011-07-10T10:18:20Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0&lt;br /&gt;
&lt;br /&gt;
===Number Formats===&lt;br /&gt;
&lt;br /&gt;
In the legacy API, currency- and amount-values (price, volume,...) where given as &#039;&#039;&#039;float&#039;&#039;&#039;. These values are likely being deprecated and replaced by fields of the same name with &amp;quot;_int&amp;quot; as postfix. These are &#039;&#039;&#039;fixed-decimal&#039;&#039;&#039;, so you have to move the decimal point yourself (divide). The exponent differs based on the kind of the value as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Kind of Field !! divide by !! Smallest possible value&lt;br /&gt;
|-&lt;br /&gt;
| BTC (volume, amount) || 1E8 (10,000,000) || 0.00000001&lt;br /&gt;
|-&lt;br /&gt;
| USD (price) || 1E5 (100,000) || 0.00001&lt;br /&gt;
|-&lt;br /&gt;
| JPY (price) || 1E3 (1,000) || 0.001&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12778</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12778"/>
		<updated>2011-07-10T10:07:58Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
ported on 7/10/2011 from http://forum.bitcoin.org/index.php?topic=5855.0&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12777</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12777"/>
		<updated>2011-07-10T10:06:27Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ticker&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;trade&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;depth&#039;&#039;&#039; contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;order_upd&#039;&#039;&#039; cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12776</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12776"/>
		<updated>2011-07-10T10:04:48Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The &#039;&#039;&#039;ticker&#039;&#039;&#039; field contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 1E8&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened (5 decimal for USD, 3 for JPY)&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 1E8&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:order_upd cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12775</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12775"/>
		<updated>2011-07-10T10:00:30Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-ed181b4a13f&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&lt;br /&gt;
  &amp;quot;ticker&amp;quot;:{&lt;br /&gt;
    &amp;quot;buy&amp;quot;:0.9515,&lt;br /&gt;
    &amp;quot;high&amp;quot;:1,&lt;br /&gt;
    &amp;quot;low&amp;quot;:0.91,&lt;br /&gt;
    &amp;quot;sell&amp;quot;:0.9697,&lt;br /&gt;
    &amp;quot;vol&amp;quot;:34349&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The &#039;&#039;&#039;ticker&#039;&#039;&#039; field contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&lt;br /&gt;
  &amp;quot;trade&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:2.71,&lt;br /&gt;
    &amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1310279340,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:14.43,&lt;br /&gt;
    &amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&lt;br /&gt;
    &amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 100000&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&lt;br /&gt;
  &amp;quot;depth&amp;quot;:{&lt;br /&gt;
    &amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&lt;br /&gt;
    &amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&lt;br /&gt;
    &amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&lt;br /&gt;
    &amp;quot;type&amp;quot;:1,&lt;br /&gt;
    &amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&lt;br /&gt;
    &amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&lt;br /&gt;
    &amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened * 100000&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 100000&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&lt;br /&gt;
  &amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&lt;br /&gt;
  &amp;quot;order_upd&amp;quot;:{&lt;br /&gt;
    &amp;quot;amount&amp;quot;:1000,&lt;br /&gt;
    &amp;quot;darkStatus&amp;quot;:0,&lt;br /&gt;
    &amp;quot;date&amp;quot;:1302836027,&lt;br /&gt;
    &amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&lt;br /&gt;
    &amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&lt;br /&gt;
  &amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
:order_upd cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12771</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12771"/>
		<updated>2011-07-10T09:43:46Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
===Connecting===&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
===Channels===&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
===Possible outgoing commands===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Incoming Data===&lt;br /&gt;
&lt;br /&gt;
====Ticker====&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-7ed181b4a13f&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&amp;quot;ticker&amp;quot;:&amp;quot;buy&amp;quot;:0.9515,&amp;quot;high&amp;quot;:1,&amp;quot;low&amp;quot;:0.91,&amp;quot;sell&amp;quot;:0.9697,&amp;quot;vol&amp;quot;:34349}}&lt;br /&gt;
&lt;br /&gt;
:The &#039;&#039;&#039;ticker&#039;&#039;&#039; field contains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| buy || lowest bid as float&lt;br /&gt;
|-&lt;br /&gt;
| sell || highest ask as float&lt;br /&gt;
|-&lt;br /&gt;
| high || maximum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| low || minimum rate since last close as float&lt;br /&gt;
|-&lt;br /&gt;
| vol || traded volume since last close&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Trade====&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&amp;quot;trade&amp;quot;:&amp;quot;amount&amp;quot;:2.71,&amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&amp;quot;date&amp;quot;:1310279340,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;price&amp;quot;:14.43,&amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 10000&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Depth====&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&amp;quot;depth&amp;quot;:{&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&amp;quot;type&amp;quot;:1,&amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;},&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened * 10000&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 10000&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Order update (private)====&lt;br /&gt;
&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;(partial key)&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;order_upd&amp;quot;:{&amp;quot;amount&amp;quot;:1000,&amp;quot;darkStatus&amp;quot;:0,&amp;quot;date&amp;quot;:1302836027,&amp;quot;oid&amp;quot;:&amp;quot;(oid)&amp;quot;,&amp;quot;price&amp;quot;:0.9899,&amp;quot;status&amp;quot;:1},&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;order_upd&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
:order_upd cointains the following:&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || change in volume of the order&lt;br /&gt;
|-&lt;br /&gt;
| darkStatus || &lt;br /&gt;
|-&lt;br /&gt;
| oid || ID of the affected order&lt;br /&gt;
|-&lt;br /&gt;
| price || &lt;br /&gt;
|-&lt;br /&gt;
| status || &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12770</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12770"/>
		<updated>2011-07-10T09:33:54Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
==Connecting==&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
==Channels==&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
==Possible outgoing commands==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==Incoming Data==&lt;br /&gt;
&lt;br /&gt;
===Ticker===&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-7ed181b4a13f&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&amp;quot;ticker&amp;quot;:&amp;quot;buy&amp;quot;:0.9515,&amp;quot;high&amp;quot;:1,&amp;quot;low&amp;quot;:0.91,&amp;quot;sell&amp;quot;:0.9697,&amp;quot;vol&amp;quot;:34349}}&lt;br /&gt;
&lt;br /&gt;
===Trade===&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&amp;quot;trade&amp;quot;:&amp;quot;amount&amp;quot;:2.71,&amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&amp;quot;date&amp;quot;:1310279340,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;price&amp;quot;:14.43,&amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 10000&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Depth===&lt;br /&gt;
&lt;br /&gt;
Changes to the market depth data are broadcast so an up-to-date market depth can be kept by clients.&lt;br /&gt;
&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;24e67e0d-1cad-4cc0-9e7a-f8523ef460fe&amp;quot;,&amp;quot;depth&amp;quot;:{&amp;quot;currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;price&amp;quot;:&amp;quot;14.43&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&amp;quot;type&amp;quot;:1,&amp;quot;type_str&amp;quot;:&amp;quot;ask&amp;quot;,&amp;quot;volume&amp;quot;:&amp;quot;-2.71&amp;quot;,&amp;quot;volume_int&amp;quot;:&amp;quot;-271000000&amp;quot;},&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;depth&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Header text !! Header text&lt;br /&gt;
|-&lt;br /&gt;
| currency || the currency affected&lt;br /&gt;
|-&lt;br /&gt;
| item || the item (BTC)&lt;br /&gt;
|-&lt;br /&gt;
| price || price as a float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || the price at which volume change happened * 10000&lt;br /&gt;
|-&lt;br /&gt;
| type || 1=ask, 2=bid. deprecated, use type_str&lt;br /&gt;
|-&lt;br /&gt;
| type_str || type of order at this depth, either &amp;quot;ask&amp;quot; or &amp;quot;bid&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| volume || the volume change as float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| volume_int || volume change * 10000&lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
|-&lt;br /&gt;
|  || &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=MOLECULAR EDITING...=&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12769</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12769"/>
		<updated>2011-07-10T09:26:27Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
==Connecting==&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
==Channels==&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally each user has a &amp;quot;own&amp;quot; channel which streams informations about orders (new order, deleted order, etc) and trades only the user&#039;s trades).&lt;br /&gt;
&lt;br /&gt;
Each message is a JSON-encoded object, with at least &amp;quot;op&amp;quot; element. The &amp;quot;op&amp;quot; element contains the operation to be done (for outgoing messages), or the type of message (for incoming messages).&lt;br /&gt;
&lt;br /&gt;
==Possible outgoing commands==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unsubscribe&#039;&#039;&#039; Stop receiving messages from a channel (parameter &amp;quot;channel&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
==Incoming Data==&lt;br /&gt;
&lt;br /&gt;
===Ticker===&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;d5f06780-30a8-4a48-a2f8-7ed181b4a13f&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;ticker&amp;quot;,&amp;quot;ticker&amp;quot;:&amp;quot;buy&amp;quot;:0.9515,&amp;quot;high&amp;quot;:1,&amp;quot;low&amp;quot;:0.91,&amp;quot;sell&amp;quot;:0.9697,&amp;quot;vol&amp;quot;:34349}}&lt;br /&gt;
&lt;br /&gt;
===Trade===&lt;br /&gt;
:{&amp;quot;channel&amp;quot;:&amp;quot;dbf1dee9-4f2e-4a08-8cb7-748919a71b21&amp;quot;,&amp;quot;op&amp;quot;:&amp;quot;private&amp;quot;,&amp;quot;origin&amp;quot;:&amp;quot;broadcast&amp;quot;,&amp;quot;private&amp;quot;:&amp;quot;trade&amp;quot;,&amp;quot;trade&amp;quot;:&amp;quot;amount&amp;quot;:2.71,&amp;quot;amount_int&amp;quot;:&amp;quot;271000000&amp;quot;,&amp;quot;date&amp;quot;:1310279340,&amp;quot;item&amp;quot;:&amp;quot;BTC&amp;quot;,&amp;quot;price&amp;quot;:14.43,&amp;quot;price_currency&amp;quot;:&amp;quot;USD&amp;quot;,&amp;quot;price_int&amp;quot;:&amp;quot;1443000&amp;quot;,&amp;quot;tid&amp;quot;:&amp;quot;1310279340877902&amp;quot;,&amp;quot;trade_type&amp;quot;:&amp;quot;bid&amp;quot;,&amp;quot;type&amp;quot;:&amp;quot;trade&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
:{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| amount || the traded amount in item (BTC), float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| amount_int || the traded amount * 10000&lt;br /&gt;
|-&lt;br /&gt;
| date || unix timestamp of trade&lt;br /&gt;
|-&lt;br /&gt;
| item || What was this trade about&lt;br /&gt;
|-&lt;br /&gt;
| price || price per unit, float, deprecated&lt;br /&gt;
|-&lt;br /&gt;
| price_int || price in smallest unit as integer (5 decimals of USD, 3 in case of JPY)&lt;br /&gt;
|-&lt;br /&gt;
| price_currency || currency in which trade was completed&lt;br /&gt;
|-&lt;br /&gt;
| tid || Trade id (big integer, which is in fact trade timestamp in microseconds)&lt;br /&gt;
|-&lt;br /&gt;
| trade_type || Did this trade result from the execution of a bid or a ask?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=MOLECULAR EDITING...=&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12768</id>
		<title>MtGox/API</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=MtGox/API&amp;diff=12768"/>
		<updated>2011-07-10T09:13:41Z</updated>

		<summary type="html">&lt;p&gt;Molecular: /* Websocket API */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[MtGox]] API provides various methods to access different informations from the market, place orders, and more.&lt;br /&gt;
&lt;br /&gt;
Two APIs are available at this point: the HTTP api (available by posting to mtgox.com/code/*) and the websocket API.&lt;br /&gt;
&lt;br /&gt;
== Legacy API ==&lt;br /&gt;
This API is available in &amp;lt;nowiki&amp;gt;https://mtgox.com/code/*&amp;lt;/nowiki&amp;gt;, and provides various informations. It also supports making an order, a withdraw, a deposit, etc.&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
Authentication is performed by posting a username and a password in variables &amp;quot;name&amp;quot; and &amp;quot;pass&amp;quot;. Some methods do not require authentication.&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
==== data/getTrades.php ====&lt;br /&gt;
This allows retrieving all trades which happened in the last 24 hours. The returned data is cached and may not reflect latest activity.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* since: Passing a tid in &amp;quot;since&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
== Websocket API ==&lt;br /&gt;
See: http://forum.bitcoin.org/index.php?topic=5855.0 (will be ported here soon)&lt;br /&gt;
&lt;br /&gt;
You can connect via: ws://websocket.mtgox.com/mtgox&lt;br /&gt;
&lt;br /&gt;
The websocket will subscribe you to some channels automatically:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Channel ID !! Description&lt;br /&gt;
|-&lt;br /&gt;
| dbf1dee9-4f2e-4a08-8cb7-748919a71b21 || trades (each time a trade happens, you get something here)&lt;br /&gt;
|-&lt;br /&gt;
| d5f06780-30a8-4a48-a2f8-7ed181b4a13f || the mtgox ticker (lots of updates, with often the same data)&lt;br /&gt;
|-&lt;br /&gt;
| 24e67e0d-1cad-4cc0-9e7a-f8523ef460fe || depth information in realtime (price + amount + type... type=1=Ask, type=2=Bid)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Help:FAQ&amp;diff=8662</id>
		<title>Help:FAQ</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Help:FAQ&amp;diff=8662"/>
		<updated>2011-05-21T22:18:52Z</updated>

		<summary type="html">&lt;p&gt;Molecular: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find answers to the most commonly asked questions.&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
=== What are bitcoins? ===&lt;br /&gt;
Bitcoins are the unit of currency of the Bitcoin system. A commonly used shorthand for this is “BTC” to refer to a price or amount (eg: “100 BTC”)&lt;br /&gt;
A Bitcoin isn&#039;t actually a &#039;thing&#039; you can point at. It is just a number associated with a [[Address|Bitcoin Address]]. See also an [[Introduction|easy intro]] to bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== How can I get Bitcoins? ===&lt;br /&gt;
&lt;br /&gt;
There are four ways to get Bitcoins:&lt;br /&gt;
&lt;br /&gt;
* Buy them on an exchange such as [https://www.mtgox.com/ Mt. Gox] or [http://www.bitcoin-otc.com/ #bitcoin-otc] on FreeNode.&lt;br /&gt;
* Accept Bitcoins as payment for goods or services.&lt;br /&gt;
* Find a local trader on [http://tradebitcoin.com tradebitcoin] (or somewhere else) and trade with him in cash&lt;br /&gt;
* Create a new [[block]] (currently yields 50 Bitcoins).&lt;br /&gt;
* Participate in a [[Pooled mining|mining pool]].&lt;br /&gt;
&lt;br /&gt;
=== Can I buy Bitcoins with Paypal? ===&lt;br /&gt;
&lt;br /&gt;
While it&#039;s possible to find an individual who wishes to sell Bitcoin to you via Paypal, (perhaps via [http://www.bitcoin-otc.com/ #bitcoin-otc] ) most major exchanges do not allow funding through Paypal. This is due to repeated cases where someone pays for Bitcoins with Paypal, receives their Bitcoins, and then fraudulently complains to Paypal that they never received their goods. Paypal too often sides with the fraudulent buyer in this case, and so exchangers no longer allow this method of funding.&lt;br /&gt;
&lt;br /&gt;
Buying Bitcoins from individuals with this method is still possible, but requires mutual trust. In this case, Bitcoin seller beware.&lt;br /&gt;
&lt;br /&gt;
=== How are new Bitcoins created? ===&lt;br /&gt;
&lt;br /&gt;
[[File:total_bitcoins_over_time_graph.png|thumb|Number of bitcoins over time, assuming a perfect 10-minute interval.]]&lt;br /&gt;
New coins are generated by a network node each time it finds the solution to a certain mathematical problem (i.e. creates a new [[block]]), which is difficult to perform and can demonstrate a [[proof of work]].  The reward for solving a block is [[controlled inflation|automatically adjusted]] so that in the first 4 years of the Bitcoin network, 10,500,000 BTC will be created. The amount is halved each 4 years, so it will be 5,250,000 over years 4-8, 2,625,000 over years 8-12 and so on. Thus the total number of coins will approach 21,000,000 BTC over time.&lt;br /&gt;
&lt;br /&gt;
In addition, built into the network is a system that attempts to allocate new coins in blocks about every 10 minutes, on average, somewhere on the network.  As the number of people who attempt to generate these new coins changes, the difficulty of creating new coins changes.  This happens in a manner that is agreed upon by the network as a whole, based upon the time taken to generate the previous 2016 blocks.  The difficulty is therefore related to the average computing resources devoted to generate these new coins over the time it took to create these previous blocks.  The likelihood of somebody &amp;quot;discovering&amp;quot; one of these blocks is based on the computer they are using compared to all of the computers also generating blocks on the network.&lt;br /&gt;
&lt;br /&gt;
=== What&#039;s the current total number of Bitcoins in existence?  ===&lt;br /&gt;
&lt;br /&gt;
[http://blockexplorer.com/q/totalbc Current count]&lt;br /&gt;
&lt;br /&gt;
The number of blocks times the coin value of a block is the number of coins in existence. The coin value of a block is 50 BTC for each of the first 210,000 blocks, 25 BTC for the next 210,000 blocks, then 12.5 BTC, 6.25 BTC and so on.&lt;br /&gt;
&lt;br /&gt;
=== How divisible are Bitcoins?  ===&lt;br /&gt;
&lt;br /&gt;
Technically, a Bitcoin can be divided down to 8 decimals using existing data structures, so 0.00000001 BTC is the smallest amount currently possible.  Discussions about and ideas for ways to provide for even smaller quantities of Bitcoins may be created in the future if the need for them ever arises.&lt;br /&gt;
&lt;br /&gt;
=== How does the halving work when the number gets really small? ===&lt;br /&gt;
&lt;br /&gt;
The reward will go from 0.00000001 BTC to 0. Then no more coins will likely be created.  &lt;br /&gt;
&lt;br /&gt;
The calculation is done as a right bitwise shift of a 64-bit signed integer, which means it is divided by 2 and rounded down. The integer is equal to the value in BTC * 100,000,000. This is how all Bitcoin balances/values are stored internally.&lt;br /&gt;
&lt;br /&gt;
Keep in mind that using current rules this will take nearly 100 years before it becomes an issue and Bitcoins may change considerably before that happens.&lt;br /&gt;
&lt;br /&gt;
=== How long will it take to generate all the coins? ===&lt;br /&gt;
&lt;br /&gt;
The last block that will generate coins will be block #6,929,999. This should be generated around year 2140. Then the total number of coins in circulation will remain static at 20,999,999.9769 BTC.&lt;br /&gt;
&lt;br /&gt;
Even if the allowed precision is expanded from the current 8 decimals, the total BTC in circulation will always be slightly below 21 million (assuming everything else stays the same). For example, with 16 decimals of precision, the end total would be 20999999.999999999496 BTC.&lt;br /&gt;
&lt;br /&gt;
=== If no more coins are going to be generated, will more blocks be created? ===&lt;br /&gt;
&lt;br /&gt;
Absolutely!  Even before the creation of coins ends, the use of [[transaction fee|transaction fees]] will likely make creating new blocks more valuable from the fees than the new coins being created.  When coin generation ends, what will sustain the ability to use bitcoins will be these fees entirely.  There will be blocks generated after block #6,929,999, assuming that people are still using Bitcoins at that time.&lt;br /&gt;
&lt;br /&gt;
=== But if no more coins are generated, what happens when Bitcoins are lost? Won&#039;t that be a problem? ===&lt;br /&gt;
&lt;br /&gt;
Not at all. Because of the law of supply and demand, when fewer Bitcoins are available the ones that are left will be in higher demand, and therefore will have a higher value. So when Bitcoins are lost, the remaining Bitcoins will increase in value to compensate. As the value of Bitcoins increase, the number of Bitcoins required to purchase an item &#039;&#039;&#039;de&#039;&#039;&#039;creases. This is known as a [[Deflationary spiral|deflationary economic model]]. Eventually, if and when it gets to the point where the largest transaction is less that 1BTC, then it&#039;s a simple matter of shifting the decimal place to the right a few places, and the system continues.&lt;br /&gt;
&lt;br /&gt;
=== If every transaction is broadcast via the network, does BitCoin scale? ===&lt;br /&gt;
The Bitcoin protocol allows lightweight clients that can use Bitcoin without downloading the entire transaction history. As traffic grows and this becomes more critical, implementations of the concept will be developed. Full network nodes will at some point become a more specialized service.&lt;br /&gt;
&lt;br /&gt;
With some modifications to the software, full BitCoin nodes could easily keep up with both VISA and MasterCard combined, using only fairly modest hardware (a couple of racks of machines using todays hardware). It&#039;s worth noting that the MasterCard network is structured somewhat like BitCoin itself - as a peer to peer broadcast network.&lt;br /&gt;
&lt;br /&gt;
Learn more about [[Scalability]].&lt;br /&gt;
&lt;br /&gt;
=== Why do I have to wait 10 minutes before I can spend money I received? ===&lt;br /&gt;
&lt;br /&gt;
The reason you have to wait 10 minutes is that&#039;s the average time taken to find a block. It can be significantly more or less time than that depending on luck, 10 minutes is simply the average case. &lt;br /&gt;
&lt;br /&gt;
Blocks (shown as &amp;quot;confirmations&amp;quot; in the GUI) are how the BitCoin achieves consensus on who owns what. Once a block is found everyone agrees that you now own those coins, so you can spend them again. Until then it&#039;s possible that some network nodes believe otherwise, if somebody is attempting to defraud the system by reversing a transaction. The more confirmations a transaction has, the less risk there is of a reversal. Only 6 blocks or 1 hour is enough to make reversal computationally impractical. This is dramatically better than credit cards which can see chargebacks occur up to three months after the original transaction!&lt;br /&gt;
&lt;br /&gt;
Why ten minutes specifically? It is a tradeoff chosen by Satoshi between propagation time of new blocks in large networks and the amount of work wasted due to chain splits. If that made no sense to you, don&#039;t worry. Reading [http://www.bitcoin.org/bitcoin.pdf the technical paper] should make things clearer.&lt;br /&gt;
&lt;br /&gt;
=== Do you have to wait 10 minutes in order to buy or sell things with BitCoin? ===&lt;br /&gt;
&lt;br /&gt;
No, it&#039;s reasonable to sell things without waiting for a confirmation as long as the transaction is not of high value.&lt;br /&gt;
&lt;br /&gt;
When people ask this question they are usually thinking about applications like supermarkets or snack machines, as discussed in [http://www.bitcoin.org/smf/index.php?topic=423.msg3819#msg3819 this thread from July 2010]. Zero confirmation transactions still show up in the GUI, but you cannot spend them. You can however reason about the risk involved in assuming you &#039;&#039;will&#039;&#039; be able to spend them in future. In general, selling things that are fairly cheap (like snacks, digital downloads etc) for zero confirmations will not pose a problem if you are running a well connected node.&lt;br /&gt;
&lt;br /&gt;
=== Why does my Bitcoin address keep changing? ===&lt;br /&gt;
&lt;br /&gt;
Whenever the address listed in &amp;quot;Your address&amp;quot; receives a transaction, Bitcoin replaces it with a new address. This is meant to encourage you to use a new address for every transaction, which enhances [[anonymity]]. All of your old addresses are still usable: you can see them in &#039;&#039;Settings -&amp;gt; Your Receiving Addresses&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Economy==&lt;br /&gt;
=== Where does the value of Bitcoin stem from? What backs up Bitcoin? ===&lt;br /&gt;
Bitcoins have value because they are accepted as payment by many. See the [[Trade|list of Bitcoin-accepting sites]].&lt;br /&gt;
&lt;br /&gt;
When we say that a currency is backed up by gold, we mean that there&#039;s a promise in place that you can exchange the currency for gold. In a sense, you could say that Bitcoin is &amp;quot;backed up&amp;quot; by the price tags of merchants – a price tag is a promise to exchange goods for a specified amount of currency.&lt;br /&gt;
&lt;br /&gt;
It&#039;s a common misconception that Bitcoins gain their value from the cost of electricity required to generate them. Cost doesn&#039;t equal value – hiring 1,000 men to shovel a big hole in the ground may be costly, but not valuable. Also, even though scarcity is a critical requirement for a useful currency, it alone doesn&#039;t make anything valuable. For example, your fingerprints are scarce, but that doesn&#039;t mean they have any exchange value.&lt;br /&gt;
&lt;br /&gt;
=== What if someone bought up all the existing Bitcoins? ===&lt;br /&gt;
What if somebody bought up all the gold in the world? Well, by attempting to buy it all, the buyer would just drive the prices up until he runs out of money.&lt;br /&gt;
&lt;br /&gt;
Not all Bitcoins are for sale.  Just as with gold, no one can buy a Bitcoin that isn&#039;t available for sale.&lt;br /&gt;
&lt;br /&gt;
=== Bitcoin&#039;s monetary policy causes a deflationary spiral ===&lt;br /&gt;
See the article [[Deflationary spiral]].&lt;br /&gt;
&lt;br /&gt;
==Networking==&lt;br /&gt;
=== Do I need to configure my firewall to run bitcoin? ===&lt;br /&gt;
&lt;br /&gt;
Bitcoin will connect to other nodes, usually on tcp port 8333. You will need to allow outgoing TCP connections to port 8333 if you want to allow your bitcoin client to connect to many nodes. Bitcoin will also try to connect to IRC (tcp port 6667) to meet other nodes to connect to.&lt;br /&gt;
&lt;br /&gt;
If you want to restrict your firewall rules to a few ips and/or don&#039;t want to allow IRC connection, you can find stable nodes in the [[Fallback Nodes|fallback nodes list]].  If your provider blocks the common IRC ports, note that lfnet also listens on port 7777.  Connecting to this alternate port currently requires either recompiling Bitcoin, or changing routing rules.  For example, on Linux you can evade a port 6667 block by doing something like this:&lt;br /&gt;
&lt;br /&gt;
 echo 173.246.103.92 irc.lfnet.org &amp;gt;&amp;gt; /etc/hosts&lt;br /&gt;
 iptables -t nat -A OUTPUT -p tcp --dest 173.246.103.92 --dport 6667 -j DNAT --to-destination :7777 -m comment --comment &amp;quot;bitcoind irc connection&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How does the peer finding mechanism work? ===&lt;br /&gt;
Bitcoin finds peers primarily by connecting to an IRC server (channel #bitcoin on irc.lfnet.org). If a connection to the IRC server cannot be established (like when connecting through TOR), an in-built node list will be used and the nodes will be queried for more node addresses.&lt;br /&gt;
&lt;br /&gt;
==Mining==&lt;br /&gt;
===What is mining?===&lt;br /&gt;
Mining is the process of spending computation power to find valid blocks and thus create new Bitcoins.&lt;br /&gt;
&lt;br /&gt;
===I&#039;ve been mining for a long time and haven&#039;t created any new Bitcoins. What&#039;s wrong?===&lt;br /&gt;
&lt;br /&gt;
In the early days of Bitcoin, it was easy for anyone to find new blocks using standard CPUs. As more and more people started mining, the [[difficulty]] of finding new blocks has greatly increased to the point where the average time for a CPU to find a single block can be many years. The only cost- or time-effective method of mining is using a high-end graphics card with special software. See here for an explanation of why: [[Why_a_GPU_mines_faster_than_a_CPU]]. Since CPU mining is essentially useless, it may be removed from new versions of the Bitcoin software.&lt;br /&gt;
&lt;br /&gt;
===Is mining used for some useful computation?===&lt;br /&gt;
The computations done when mining are internal to Bitcoin and not related to any other distributed computing projects. They serve the purpose of securing the Bitcoin network, which is useful.&lt;br /&gt;
&lt;br /&gt;
===Is it not a waste of energy?===&lt;br /&gt;
Spending energy on creating a free monetary system is hardly a waste. Also, services necessary for the operation of currently widespread monetary systems, such as banks and credit card companies, also spend energy, arguably more than Bitcoin would.&lt;br /&gt;
&lt;br /&gt;
===Why don&#039;t we use calculations that are also useful for some other purpose?===&lt;br /&gt;
To provide security for the Bitcoin network, the calculations involved need to have some very specific features. These features are incompatible with leveraging the computation for other purposes.&lt;br /&gt;
&lt;br /&gt;
==Help==&lt;br /&gt;
===I&#039;d like to learn more.  Where can I get help?===&lt;br /&gt;
&lt;br /&gt;
* Read the [[Introduction|introduction to bitcoin]] &lt;br /&gt;
* See the videos, podcasts, and blog posts from the [[Press]]&lt;br /&gt;
* Read and post on the [[Bitcoin:Community_portal#Bitcoin_Community_Forums|forums]]&lt;br /&gt;
* Chat on one of the [[Bitcoin:Community_portal#IRC_Chat|Bitcoin IRC]] channels&lt;br /&gt;
* Listen to [http://omegataupodcast.net/2011/03/59-bitcoin-a-digital-decentralized-currency/ this podcast], which goes into the details of how bitcoin works&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Man page]]&lt;br /&gt;
* [[Introduction]]&lt;br /&gt;
&lt;br /&gt;
[[zh-cn:FAQ]]&lt;br /&gt;
[[fr:FAQ]]&lt;br /&gt;
{{fromold|bitcoins}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Merchant_Howto&amp;diff=8501</id>
		<title>Talk:Merchant Howto</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Merchant_Howto&amp;diff=8501"/>
		<updated>2011-05-18T07:55:46Z</updated>

		<summary type="html">&lt;p&gt;Molecular: Created page with &amp;quot;I think most merchant will want to also also automatically adjust their prices according to BTC market value.  Has anyone here done this? It doesn&amp;#039;t seem too hard to pull the rat...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think most merchant will want to also also automatically adjust their prices according to BTC market value.&lt;br /&gt;
&lt;br /&gt;
Has anyone here done this? It doesn&#039;t seem too hard to pull the rate from mtgox at a certain depth or something, but I&#039;d hate to describe something I&#039;ve never done myself.&lt;br /&gt;
&lt;br /&gt;
Also, I this is lacking any mention of mybitcoin and mtgox merchant apis.&lt;br /&gt;
&lt;br /&gt;
So please, can someone help? Making it easier for merchants to use bitcoin is important.&lt;/div&gt;</summary>
		<author><name>Molecular</name></author>
	</entry>
</feed>