<p>Current market depth available at </p>

<ul>
<li><a href="https://mtgox.com/api/0/data/getDepth.php?Currency=USD">https://mtgox.com/api/0/data/getDepth.php?Currency=USD</a></li>
</ul>

<p>All trades which happened in the last 24 hours available at</p>

<ul>
<li><a href="https://mtgox.com/code/data/getTrades.php">https://mtgox.com/code/data/getTrades.php</a></li>
</ul>

<p>Retrieves 100 trades that happend after specified transaction</p>

<ul>
<li><a href="https://mtgox.com/code/data/getTrades.php?since=">https://mtgox.com/code/data/getTrades.php?since=</a>"transaction tid"</li>
</ul>

<p>A script is required to retrive all historical data, like the one <a href="https://bitcointalk.org/index.php?topic=39402.0">posted by mizerydearia</a>. The idea is to cycle download request while incrementing "transaction tid" aka "lasttrade" to download all data in steps.</p>

<pre><code>#!/bin/bash
outputfile=data
lasttrade=0
while test -n "$lasttrade";do
    wget --quiet https://mtgox.com/code/data/getTrades.php?since=$lasttrade
    if test "`cat getTrades.php\?since\=$lasttrade`" != "[]";then
        cat getTrades.php\?since\=* &gt;&gt; $outputfile;
        echo &gt;&gt; $outputfile;
        lasttrade=`cat getTrades.php\?since\=$lasttrade|sed "s/,/\n/g"|grep tid|tail -n 1|cut -d ":" -f 2|cut -d "\"" -f 2`;
        lasttradets=`cat getTrades.php\?since\=*|sed "s/,/\n/g"|grep date|tail -n 1|cut -d ":" -f 2`;
        echo "$(date -d @$lasttradets)  tid $lasttrade"
    else
        echo Finished
    fi
    rm getTrades.php\?since\=*;
done
</code></pre>

<p>See <a href="https://en.bitcoin.it/wiki/MtGox/API">MtGox - API</a> for more http API calls.</p>

CC BY-SA 3.0
2013-02-22T16:01:50.240Z
Any idea how big this file is today? I'm at about *3.5 gb* right now and still going.
jordan.baucke
CC BY-SA 3.0
2013-12-08T03:33:59.733Z
@jordan.baucke what size did you get?
kirill_igum
CC BY-SA 3.0
2014-01-13T04:32:40.500Z
I'm running a similar script -- it's currently up to 10/20/2011 @ ~ 155 MB uncompressed -- I'll let you know when it completes, and see if I can dump it up online somewhere.
BrainSlugs83
CC BY-SA 3.0
2014-01-13T09:46:53.900Z
Well, I got to 3/11/2013 -- and it's only about ~670 MB so far.  So there must be a bug in the above script.  Probably related to the fact that it's parsing the JSON with Regex.  Maybe an error is being thrown every so often, and it's starting over at the error code (using it as a TID) or something?
BrainSlugs83
CC BY-SA 3.0
2014-01-14T12:15:58.873Z
I got up to date (1/14/2014) this morning -- completely uncompressed, the JSON is about 1.33 GB -- compressed in a regular .zip file, it's about 160 MB.  I used the URL and the approach described above (slightly different implementation), and although it does not mention USD in the URL, the results appear to be in USD only (maybe that happened when they changed the API? This could also be the reason for the much smaller file size).  At any rate, I've posted my dump here: http://bit.ly/1dMzqhJ
BrainSlugs83
CC BY-SA 3.0
2011-10-18T03:52:55.780Z
2011-10-20T20:21:54.670Z
2011-10-20T20:21:54.670Z
Serith
<p>To get ALL mtgoxUSD trades since the start you can use the following url:</p>

<p>www.bitcoincharts.com/t/trades.csv?symbol=mtgoxUSD&amp;start=0</p>

<p>WARNING. This generates a 49mb csv at the moment and can take some time, so please only follow the link if you actually need the data. </p>

<p>Visit <a href="http://bitcoincharts.com/about/markets-api/" rel="nofollow">http://bitcoincharts.com/about/markets-api/</a> for more information.</p>

CC BY-SA 3.0
2013-12-08T03:33:09.667Z
i think this is daily not tick data
kirill_igum
CC BY-SA 3.0
2012-03-09T16:39:20.890Z
2012-03-09T16:39:20.890Z
AshRolls
<p>Just noting here that MtGox tid's are not included in the data you get from bitcoincharts in that csv call API, and they switched from numerical indexing to microsecond timestamping a while back. In trying to maintain a db with integrity, you need the unique tid data... The history file is now over 100MB also.</p>

CC BY-SA 3.0
2012-10-07T15:46:25.600Z
2012-10-07T15:56:55.070Z
2012-10-07T15:56:55.070Z
cryptozoan
<h1>Original MtGox Shared Dataset</h1>

<p>Once upon a time there was a Google BigQuery dataset that was updated often with MtGox's official trade record. That's no longer being published because... ask <a href="http://en.wikipedia.org/wiki/Mark_Karpeles" rel="nofollow">someone who should explain it</a>.</p>

<h3>Data on Google BigQuery</h3>

<p>The BigQuery shared MtGox Trades dataset is (@2014-04-20) available at
<a href="https://bigquery.cloud.google.com/dataset/931531665892%3amtgox" rel="nofollow">https://bigquery.cloud.google.com/dataset/931531665892:mtgox</a></p>

<h3>The BitTorrent Version</h3>

<p>If you'd <em>rather not BigQuery</em>, but <em>you still want that data</em>, there's a torrent, here's the full-metal-magnet.  </p>

<pre><code>magnet:?xt=urn:btih:c87cd62f9484993f0153a47fc51f06fb43ed71ee&dn=931531665892-mtgox-trades.csv&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A80</code></pre>

<h2>The MtGox Leak Database</h2>

<p>In 2014 the Magic The Gathering Online eXchange (MtGox) server was compromised. Source code, user account details and trade data were made public.</p>

<p>For academic research the trade data is useful, here's a magnet to the original "public service release" file, <code>MtGox2014Leak.zip</code>. <a href="https://www.virustotal.com/en/file/4be75071e325d84e6ac45c64598f0957ff6f8f431cae1419402702b4f48f3c10/analysis/" rel="nofollow"><strong>BEWARE</strong>: The <code>TibanneBackOffice.zip</code> file contains a trojan</a></p>

<pre><code>magnet:?xt=urn:btih:b6545ecc7db8d44c8cbc4e93989edf8221af75f5&dn=2014+Mt.+Gox+Leak&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337</code></pre>

<p>Alternatively, <a href="http://cryptoanarchic.me" rel="nofollow">cryptoanarchic.me</a> have kindly provided an <a href="http://cryptoanarchic.me/goxhax/MtGox2014Leak.zip" rel="nofollow">HTTP mirrored version of MtGox2014Leak.zip</a>.</p>

<p>Those are the two data sources I'm using in my research.</p>

CC BY-SA 3.0
2014-04-20T14:48:30.630Z
2014-04-20T14:54:54.093Z
2014-04-20T14:54:54.093Z
captainpete
<p>Has anyone stored the historical market depth &amp; tick data from MtGox? Is it available publically? Would be useful if you were making a bot.</p>

CC BY-SA 3.0
2011-10-19T00:30:27.647Z
Related, there is a BitcoinCharts API which provides some timeseries information http://bitcoincharts.com/about/markets-api/
ACyclic
CC BY-SA 3.0
2011-10-26T03:00:53.043Z
I have emailed MtGox and TradeHill about this, have not received a reply. Clark Moody doesn't store historic market depth information as there's too much data.
ACyclic
CC BY-SA 3.0
2011-10-26T14:22:34.897Z
I think that's the main problem. It really is too much data.
nmat
CC BY-SA 3.0
2011-10-28T14:49:20.293Z
I grabbed a simple script I had and I got it fetching market depth every 5 seconds and saving the differences (I should use websockets, but I didn't have a script ready). After 2 days I have ~5MB of data so maybe this is not that hard to do. The data could be even saved in a more compressed format (I am just dumping what MtGox gives me). It's just a matter of setting up a server running 24/7 with a script like this.
nmat
<mtgox><trading><raw-data><market-depth>
Is there a historical timeseries of market depth & transactions available?
ACyclic
# Is there a historical timeseries of market depth & transactions available?

(Asked by: username_0 on 2011-10-18)

Has anyone stored the historical market depth & tick data from MtGox? Is it available publically? Would be useful if you were making a bot.

**Tags:** mtgox, trading, raw-data, market-depth

> **Comments:**
> **username_0**: Related, there is a BitcoinCharts API which provides some timeseries information http://bitcoincharts.com/about/markets-api/  
> **username_0**: I have emailed MtGox and TradeHill about this, have not received a reply. Clark Moody doesn't store historic market depth information as there's too much data.  
> **username_1**: I think that's the main problem. It really is too much data.  
> **username_1**: I grabbed a simple script I had and I got it fetching market depth every 5 seconds and saving the differences (I should use websockets, but I didn't have a script ready). After 2 days I have ~5MB of data so maybe this is not that hard to do. The data could be even saved in a more compressed format (I am just dumping what MtGox gives me). It's just a matter of setting up a server running 24/7 with a script like this.  

---

## 4 answers

### Answer by username_2 on 2011-10-18. Score: 12

Current market depth available at

* <https://mtgox.com/api/0/data/getDepth.php?Currency=USD>

All trades which happened in the last 24 hours available at

* <https://mtgox.com/code/data/getTrades.php>

Retrieves 100 trades that happend after specified transaction

* <https://mtgox.com/code/data/getTrades.php?since=>"transaction tid"

A script is required to retrive all historical data, like the one [posted by mizerydearia](https://bitcointalk.org/index.php?topic=39402.0). The idea is to cycle download request while incrementing "transaction tid" aka "lasttrade" to download all data in steps.

```
#!/bin/bash
outputfile=data
lasttrade=0
while test -n "$lasttrade";do
    wget --quiet https://mtgox.com/code/data/getTrades.php?since=$lasttrade
    if test "`cat getTrades.php\?since\=$lasttrade`" != "[]";then
        cat getTrades.php\?since\=* >> $outputfile;
        echo >> $outputfile;
        lasttrade=`cat getTrades.php\?since\=$lasttrade|sed "s/,/\n/g"|grep tid|tail -n 1|cut -d ":" -f 2|cut -d "\"" -f 2`;
        lasttradets=`cat getTrades.php\?since\=*|sed "s/,/\n/g"|grep date|tail -n 1|cut -d ":" -f 2`;
        echo "$(date -d @$lasttradets)  tid $lasttrade"
    else
        echo Finished
    fi
    rm getTrades.php\?since\=*;
done

```

See [MtGox - API](https://en.bitcoin.it/wiki/MtGox/API) for more http API calls.

> **Comments:**
> **username_3**: Any idea how big this file is today? I'm at about *3.5 gb* right now and still going.  
> **username_4**: @username_3 what size did you get?  
> **username_5**: I'm running a similar script -- it's currently up to 10/20/2011 @ ~ 155 MB uncompressed -- I'll let you know when it completes, and see if I can dump it up online somewhere.  
> **username_5**: Well, I got to 3/11/2013 -- and it's only about ~670 MB so far.  So there must be a bug in the above script.  Probably related to the fact that it's parsing the JSON with Regex.  Maybe an error is being thrown every so often, and it's starting over at the error code (using it as a TID) or something?  
> **username_5**: I got up to date (1/14/2014) this morning -- completely uncompressed, the JSON is about 1.33 GB -- compressed in a regular .zip file, it's about 160 MB.  I used the URL and the approach described above (slightly different implementation), and although it does not mention USD in the URL, the results appear to be in USD only (maybe that happened when they changed the API? This could also be the reason for the much smaller file size).  At any rate, I've posted my dump here: http://bit.ly/1dMzqhJ  

---

### Answer by username_6 on 2012-03-09. Score: 3

To get ALL mtgoxUSD trades since the start you can use the following url:

www.bitcoincharts.com/t/trades.csv?symbol=mtgoxUSD&start=0

WARNING. This generates a 49mb csv at the moment and can take some time, so please only follow the link if you actually need the data.

Visit <http://bitcoincharts.com/about/markets-api/> for more information.

> **Comments:**
> **username_4**: i think this is daily not tick data  

---

### Answer by username_7 on 2012-10-07. Score: 2

Just noting here that MtGox tid's are not included in the data you get from bitcoincharts in that csv call API, and they switched from numerical indexing to microsecond timestamping a while back. In trying to maintain a db with integrity, you need the unique tid data... The history file is now over 100MB also.


---

### Answer by username_8 on 2014-04-20. Score: 1

# Original MtGox Shared Dataset

Once upon a time there was a Google BigQuery dataset that was updated often with MtGox's official trade record. That's no longer being published because... ask [someone who should explain it](http://en.wikipedia.org/wiki/Mark_Karpeles).

### Data on Google BigQuery

The BigQuery shared MtGox Trades dataset is (@2014-04-20) available at
[https://bigquery.cloud.google.com/dataset/931531665892:mtgox](https://bigquery.cloud.google.com/dataset/931531665892%3amtgox)

### The BitTorrent Version

If you'd *rather not BigQuery*, but *you still want that data*, there's a torrent, here's the full-metal-magnet.

```
magnet:?xt=urn:btih:c87cd62f9484993f0153a47fc51f06fb43ed71ee&dn=931531665892-mtgox-trades.csv&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A80
```

## The MtGox Leak Database

In 2014 the Magic The Gathering Online eXchange (MtGox) server was compromised. Source code, user account details and trade data were made public.

For academic research the trade data is useful, here's a magnet to the original "public service release" file, `MtGox2014Leak.zip`. [**BEWARE**: The `TibanneBackOffice.zip` file contains a trojan](https://www.virustotal.com/en/file/4be75071e325d84e6ac45c64598f0957ff6f8f431cae1419402702b4f48f3c10/analysis/)

```
magnet:?xt=urn:btih:b6545ecc7db8d44c8cbc4e93989edf8221af75f5&dn=2014+Mt.+Gox+Leak&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337
```

Alternatively, [cryptoanarchic.me](http://cryptoanarchic.me) have kindly provided an [HTTP mirrored version of MtGox2014Leak.zip](http://cryptoanarchic.me/goxhax/MtGox2014Leak.zip).

Those are the two data sources I'm using in my research.


---

