Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

BTCTurkTracker is a Scala application that periodically collects data from BTCTurk API.


You can build a JAR out of Scala sources using sbt:

$ git clone
$ cd BTCTurkTracker
$ sbt assembly

assembly task creates a BTCTurkTracker-assembly-<VERSION>.jar under target/scala-<VERSION> directory. You can use this jar as follows.

$ java -jar target/scala-2.10/BTCTurkTracker-assembly-0.1.jar -h
  Usage: <main class> [options]
      -h, --help

         Default: false
    * -o, --outputDir
         Data storage directory.
      -p, --updatePeriod
         Data update period (in seconds)
         Default: 3

Note that BTCTurk API allows at most 1 request per second. BTCTurkTracker performs 3 requests in sequential order: ticker, orderbook, and trades. In order to not exceed the maximum request threshold, updatePeriod parameter must be larger than or equal to 3.

$ java -jar target/scala-2.10/BTCTurkTracker-assembly-0.1.jar -o /tmp/btc -p 3

Alternatively, you can start BTCTurkTracker using the shell script provided under bin directory.

$ bin/
Usage: bin/ <BTCTurkTracker.jar> <outputDirectory> [<updatePeriod>]

Shell script contains some extra JVM flags for optimization.


When you start BTCTurkTracker, it starts to periodically collect data to the specified directory. The contents of the outputDirectory is as follows:


Each file contains the tabulated raw data collected through the corresponding API call. Formats of the generated files are as follows.

last_trade_id.txt contains the last received trade id from the trades API call. A sample content of the file is presented below.

$ cat /tmp/btc/last_trade_id.txt
5327149b3ab4750c7c4c3d73 contains the list of ticker API call responses. Each line contains the following TAB separated fields:

  • <timestamp>
  • <low>
  • <high>
  • <last>
  • <bid>
  • <ask>
  • <volume>

A sample snippet of is as follows.

$ head -n 1 /tmp/btc/2014/03/17/
1395070197.0    1373.47    1406.11    1387.10    1384.00    1387.10    48.15 contains the list of orderbook API call responses. Each line contains the following TAB separated fields:

  • <timestamp>
  • <bid_0_price>:<bid_0_amount>,<bid_1_price>:<bid_1_amount>,...
  • <ask_0_price>:<ask_0_amount>,<ask_1_price>:<ask_1_amount>,...

A sample snippet of is as follows.

$ head -n 1 /tmp/btc/2014/03/17/
1395070282.0    1384.00:0.72632458,1382.01:0.00126072,...    1798.01:2.29470410,1799.00:0.72592064,... lists the trades API call responses. Each line contains a TAB separated list of trades, where each trade is represented as follows: <timestamp>,<tid>,<price>,<amount>.


The BTCTurkTracker by Volkan Yazıcı is licensed under the Creative Commons Attribution 4.0 International License.

Creative Commons Attribution 4.0 International License


BTCTurk data collector.



No releases published


No packages published
You can’t perform that action at this time.