Bitcoin Forum
May 08, 2024, 03:10:24 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: JSON API for Trades  (Read 1803 times)
mizerydearia (OP)
Hero Member
*****
Offline Offline

Activity: 574
Merit: 507



View Profile
September 26, 2011, 08:44:10 PM
Last edit: September 26, 2011, 09:48:11 PM by mizerydearia
 #1

A few exchanges presented to me JSON data for trade history in a not so friendly data format, and I wanted to explain to them how I (anyone else?) prefers the data to be.  What better way than by example?  Here are examples:

Note: The data usually is on a single line, without spacing.  Each trade data is on its own line for easy reading.

http://api.virwox.com/api/json.php?method=getRawTradeData&instrument=BTC/SLL&timespan=999999999
Code:
{"result":{"errorCode":"OK","data":[{"time":"1303920309","price":"485","vol":"1","tid":"414926"},
{"time":"1304023419","price":"500","vol":"100","tid":"416114"},
{"time":"1304024203","price":"500","vol":"100","tid":"416121"},
...]},"error":null,"id":null}

http://aqoin.me/bitcoincharts/EUR/trades.php?tid=0
Code:
[{"date":1314964052,"price":6.5,"amount":0.4,"tid":1},
{"date":1316277154,"price":3.75,"amount":0.5,"tid":2},
{"date":1316300526,"price":4,"amount":4,"tid":3}
,...]

https://btcex.com/site/realtimejson/id/2
Code:
[{"date":1317065461, "price":4.4986, "amount":62.89, "tid":202380},
 {"date":1317064932, "price":4.4749, "amount":50.23, "tid":202370},
 {"date":1317053747, "price":4.8498, "amount":8.40, "tid":202360},
...]

http://exchange.bitparking.com:8080/api/t
Code:
[{"date":"1317064247","price":0.02300300,"amount":1.53212565,"id":"17097"}
,{"date":"1317060030","price":0.02500000,"amount":39.00000000,"id":"17096"}
,{"date":"1317051631","price":0.02500000,"amount":0.18009630,"id":"17095"}
,...]

http://i0exchange.bitparking.com:8080/api/t
Code:
[{"date":"1317065004","price":0.00050270,"amount":19.00000000,"id":"8376"}
,{"date":"1317063976","price":0.00050270,"amount":260.60000000,"id":"8375"}
,{"date":"1317063921","price":0.00050271,"amount":89.00000000,"id":"8374"}
...]

http://ixchange.bitparking.com:8080/api/t
Code:
[{"date":"1317066858","price":0.00118450,"amount":273.61547360,"id":"9522"}
,{"date":"1317066229","price":0.00118451,"amount":87.98000000,"id":"9521"}
,{"date":"1317066229","price":0.00118451,"amount":0.02000000,"id":"9520"}
...]

http://www.mercadobitcoin.com.br/api/trades/
Code:
[{"date":1311859832,"price":23.99000000,"amount":1.00000000,"tid":1},
{"date":1311892531,"price":23.99000000,"amount":1.00000000,"tid":2},
{"date":1311973233,"price":23.49000000,"amount":2.00000000,"tid":3},
...]            

https://api.tradehill.com/APIv1/AUD/Trades
Code:
[]

https://api.tradehill.com/APIv1/CLP/Trades
Code:
[]

https://api.tradehill.com/APIv1/EUR/Trades
Code:
[{"date": 1317061036, "tid": 176114, "price": "3.7089999300", "amount": "0.7726897800"},
{"date": 1317061102, "tid": 176120, "price": "3.5400000000", "amount": "10.1430000000"},
{"date": 1317061102, "tid": 176122, "price": "3.5320000000", "amount": "5.6430000000"},
...]

https://api.tradehill.com/APIv1/INR/Trades
Code:
[]

https://api.tradehill.com/APIv1/LR/Trades
Code:
[{"date": 1317063354, "tid": 176230, "price": "4.4000000000", "amount": "0.2350000000"},
{"date": 1317063363, "tid": 176232, "price": "4.4000000000", "amount": "19.0000000000"},
{"date": 1317063519, "tid": 176234, "price": "4.7999000000", "amount": "0.2340000000"}]

https://api.tradehill.com/APIv1/USD/Trades
Code:
[{"date": 1317056936, "tid": 175906, "price": "4.8910000000", "amount": "0.1100000000"},
{"date": 1317057005, "tid": 175908, "price": "4.9620000000", "amount": "0.3530669210"},
{"date": 1317057005, "tid": 175910, "price": "4.9939999985", "amount": "0.1469330790"},
...]

https://bitchange.pl/data/trades.json
Code:
[{"price":"16.49000000","amount":"2.02000000","type":1,"date":1317067386,"tid":5651},
{"price":"16.49000000","amount":"0.08060000","type":1,"date":1317066965,"tid":5650},
{"price":"16.50000000","amount":"1.91940000","type":1,"date":1317066965,"tid":5649},
...]

https://bitcoin-central.net/trades.json?currency=CAD
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitcoin-central.net/trades.json?currency=EUR
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitcoin-central.net/trades.json?currency=INR
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitcoin-central.net/trades.json?currency=LREUR
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitcoin-central.net/trades.json?currency=LRUSD
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitcoin-central.net/trades.json?currency=PGAU
Code:
[{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"},
{"date":1316932411,"price":5.9,"amount":7.45,"currency":"CAD"},
{"date":1316896377,"price":5.94,"amount":9.8484,"currency":"CAD"},
...]

https://bitmarket.eu/api/get_transactions/days:1,currency:EUR
Code:
[{"date":"1317065920","currency":"EUR","amount":"5.00000000","price":"4.38000000","tx_id":"15472"},
{"date":"1317053625","currency":"EUR","amount":"2.00000000","price":"4.20000000","tx_id":"15404"},
{"date":"1317047839","currency":"EUR","amount":"10.00000000","price":"4.29000000","tx_id":"15559"},
...]

https://bitmarket.eu/api/get_transactions/days:1,currency:GBP
Code:
[{"date":"1317058561","currency":"GBP","amount":"6.00000000","price":"4.00000000","tx_id":"15555"},
{"date":"1317027877","currency":"GBP","amount":"10.00000000","price":"3.60000000","tx_id":"15618"}]

https://bitmarket.eu/api/get_transactions/days:1,currency:PLN
Code:
[]

https://bitmarket.eu/api/get_transactions/days:1,currency:RUB
Code:
[]

https://bitmarket.eu/api/get_transactions/days:1,currency:USD
Code:
[{"date":"1317067112","currency":"USD","amount":"20.00000000","price":"6.00000000","tx_id":"15621"},
{"date":"1317012723","currency":"USD","amount":"1.50000000","price":"5.95000000","tx_id":"15654"},
{"date":"1317001489","currency":"USD","amount":"4.00000000","price":"5.55000000","tx_id":"15604"}]

https://britcoin.co.uk/api/getTrades.php
Code:
[{"price":"3.24000","amount":"2.00000","tid":8991,"date":1317067530,"timestamp":"1317067530.98563"},
{"price":"3.24000","amount":"0.01000","tid":8990,"date":1317067454,"timestamp":"1317067454.08763"},
{"price":"3.23999","amount":"0.99000","tid":8989,"date":1317067454,"timestamp":"1317067454.08763"},
...]

https://btc-e.com/api/1/trades
Code:
[{"date":1317067318,"price":4.5,"amount":80,"tid":5119,"price_currency":"USD","item":"BTC","trade_type":"bid"},
{"date":1317066896,"price":4.5,"amount":6.905,"tid":5118,"price_currency":"USD","item":"BTC","trade_type":"bid"},
{"date":1317065020,"price":4.5,"amount":169.956,"tid":5116,"price_currency":"USD","item":"BTC","trade_type":"bid"},
...]

https://campbx.com/api/recenthistory.php?Unixtime=0
Code:
[{"Time":1317067152,"Price":"4.97","Bitcoins":"3.00000000","Order ID":"60102"},
{"Time":1317067043,"Price":"4.95","Bitcoins":"1.00000000","Order ID":"60098"},
{"Time":1317066633,"Price":"4.90","Bitcoins":"0.20000000","Order ID":"60094"},
...]

https://www.exchangebitcoins.com/data/recent
Code:
[{"date":1317071595,"price":5.00000000,"amount":0.25,"tid":31490},
{"date":1317070625,"price":5.35000000,"amount":18.9164,"tid":31488},
{"date":1317070578,"price":5.35000000,"amount":35.71,"tid":31487},
...]

https://hellobitcoin.com/api/data/historical?format=json
Code:
[{"contract_id": "", "exchange": "", "timestamp": "", "price": "", "timestamp_posix": "", "field": "", "quantity": ""}]

https://intersango.com/api/trades.php?currency_pair_id=1&last_trade_id=0
Code:
[{"price":"3.24000","amount":"2.00000","tid":8991,"date":1317067530,"timestamp":"1317067530.98563"},
{"price":"3.24000","amount":"0.01000","tid":8990,"date":1317067454,"timestamp":"1317067454.08763"},
{"price":"3.23999","amount":"0.99000","tid":8989,"date":1317067454,"timestamp":"1317067454.08763"},
...]

https://intersango.com/api/trades.php?currency_pair_id=2&last_trade_id=0
Code:
[{"price":"3.70000","amount":"70.00000","tid":8947,"date":1317055898,"timestamp":"1317055898.73145"},
{"price":"3.75000","amount":"6.41565","tid":8942,"date":1317051843,"timestamp":"1317051843.76308"},
{"price":"3.90000","amount":"0.00070","tid":8940,"date":1317051317,"timestamp":"1317051317.75505"},
...]

https://intersango.com/api/trades.php?currency_pair_id=3&last_trade_id=0
Code:
[{"price":"5.00000","amount":"0.20000","tid":8978,"date":1317066626,"timestamp":"1317066626.96089"},
{"price":"5.00000","amount":"0.20000","tid":8976,"date":1317065683,"timestamp":"1317065683.65658"},
{"price":"5.00000","amount":"0.20000","tid":8975,"date":1317063749,"timestamp":"1317063749.15603"},
...]

https://intersango.com/api/trades.php?currency_pair_id=4&last_trade_id=0
Code:
[]

https://mtgox.com/api/1/BTCAUD/public/trades?since=0
Code:
{"result":"success","return":[{"date":1314960296,"price":"7.6974","amount":"0.01","price_int":"769740","amount_int":"1000000","tid":"1314960296336659","price_currency":"AUD","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1314960296,"price":"7.69738","amount":"0.01","price_int":"769738","amount_int":"1000000","tid":"1314960296413959","price_currency":"AUD","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1314960296,"price":"7.68577","amount":"0.01","price_int":"768577","amount_int":"1000000","tid":"1314960296479290","price_currency":"AUD","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCCAD/public/trades?since=0
Code:
{"result":"success","return":[]}

https://mtgox.com/api/1/BTCCHF/public/trades?since=0
Code:
{"result":"success","return":[{"date":1315033190,"price":"6.52099","amount":"0.09248789","price_int":"652099","amount_int":"9248789","tid":"1315033190188144","price_currency":"CHF","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315033219,"price":"6.52098","amount":"1","price_int":"652098","amount_int":"100000000","tid":"1315033219194810","price_currency":"CHF","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
{"date":1315033259,"price":"6.49036","amount":"0.50679378","price_int":"649036","amount_int":"50679378","tid":"1315033259280556","price_currency":"CHF","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCCNY/public/trades?since=0
Code:
{"result":"success","return":[{"date":1314976798,"price":"52.77089","amount":"0.994","price_int":"5277089","amount_int":"99400000","tid":"1314976798877173","price_currency":"CNY","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315749041,"price":"31.00074","amount":"0.49785","price_int":"3100074","amount_int":"49785000","tid":"1315749041805482","price_currency":"CNY","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315914851,"price":"37.4657","amount":"10","price_int":"3746570","amount_int":"1000000000","tid":"1315914851748942","price_currency":"CNY","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCDKK/public/trades?since=0
Code:
{"result":"success","return":[{"date":1315327386,"price":"35.65763","amount":"14.08306153","price_int":"3565763","amount_int":"1408306153","tid":"1315327386584660","price_currency":"DKK","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"},
{"date":1315327472,"price":"35.85053","amount":"2.80780786","price_int":"3585053","amount_int":"280780786","tid":"1315327472987192","price_currency":"DKK","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"}]}

https://mtgox.com/api/1/BTCEUR/public/trades?since=0
Code:
{"result":"success","return":[{"date":1314432197,"price":"6.00774","amount":"1.35171181","price_int":"600774","amount_int":"135171181","tid":"1314432197609817","price_currency":"EUR","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
{"date":1314452650,"price":"6.10256","amount":"0.09395","price_int":"610256","amount_int":"9395000","tid":"1314452650185558","price_currency":"EUR","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
{"date":1314452835,"price":"6.11665","amount":"0.09504","price_int":"611665","amount_int":"9504000","tid":"1314452835796359","price_currency":"EUR","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCGBP/public/trades?since=0
Code:
{"result":"success","return":[{"date":1315289847,"price":"4.44481","amount":"0.3","price_int":"444481","amount_int":"30000000","tid":"1315289847845080","price_currency":"GBP","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"},
{"date":1315289847,"price":"4.44487","amount":"2.62472468","price_int":"444487","amount_int":"262472468","tid":"1315289847904509","price_currency":"GBP","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"},
{"date":1315289848,"price":"4.44487","amount":"2.66","price_int":"444487","amount_int":"266000000","tid":"1315289848031615","price_currency":"GBP","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCHKD/public/trades?since=0
Code:
{"result":"success","return":[]}

https://mtgox.com/api/1/BTCJPY/public/trades?since=0
Code:
{"result":"success","return":[{"date":1314431307,"price":"700.992","amount":"1","price_int":"700992","amount_int":"100000000","tid":"1314431307302749","price_currency":"JPY","item":"BTC","trade_type":"bid","primary":"Y","properties":"limit,mixed_currency"},
{"date":1314694966,"price":"690.56","amount":"18.78407847","price_int":"690560","amount_int":"1878407847","tid":"1314694966125651","price_currency":"JPY","item":"BTC","trade_type":"ask","primary":"Y","properties":"limit,mixed_currency"},
{"date":1314696366,"price":"680","amount":"10","price_int":"680000","amount_int":"1000000000","tid":"1314696366702056","price_currency":"JPY","item":"BTC","trade_type":"ask","primary":"Y","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCNZD/public/trades?since=0
Code:
{"result":"success","return":[]}

https://mtgox.com/api/1/BTCPLN/public/trades?since=0
Code:
{"result":"success","return":[{"date":1314965472,"price":"23.77729","amount":"0.497","price_int":"2377729","amount_int":"49700000","tid":"1314965472992278","price_currency":"PLN","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315007777,"price":"24.34081","amount":"3.47","price_int":"2434081","amount_int":"347000000","tid":"1315007777752869","price_currency":"PLN","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315145082,"price":"23.589","amount":"0.1","price_int":"2358900","amount_int":"10000000","tid":"1315145082429257","price_currency":"PLN","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCRUB/public/trades?since=0
Code:
{"result":"success","return":[{"date":1315756853,"price":"141.07803","amount":"25","price_int":"14107803","amount_int":"2500000000","tid":"1315756853744717","price_currency":"RUB","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315756853,"price":"141.03826","amount":"0.01101952","price_int":"14103826","amount_int":"1101952","tid":"1315756853939302","price_currency":"RUB","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315756854,"price":"141.00859","amount":"0.55405047","price_int":"14100859","amount_int":"55405047","tid":"1315756854108387","price_currency":"RUB","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCSEK/public/trades?since=0
Code:
{"result":"success","return":[{"date":1315150133,"price":"51.205","amount":"6","price_int":"51205","amount_int":"600000000","tid":"1315150133733084","price_currency":"SEK","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315150278,"price":"51.205","amount":"6","price_int":"51205","amount_int":"600000000","tid":"1315150278806120","price_currency":"SEK","item":"BTC","trade_type":"ask","primary":"N","properties":"limit,mixed_currency"},
{"date":1315151033,"price":"51.205","amount":"8","price_int":"51205","amount_int":"800000000","tid":"1315151033584558","price_currency":"SEK","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"},
...]}

https://mtgox.com/api/1/BTCSGD/public/trades?since=0
Code:
{"result":"success","return":[{"date":1316353287,"price":"5.84606","amount":"0.212","price_int":"584606","amount_int":"21200000","tid":"1316353287423765","price_currency":"SGD","item":"BTC","trade_type":"bid","primary":"N","properties":"limit,mixed_currency"}]}

https://mtgox.com/api/1/BTCTHB/public/trades?since=0
Code:
{"result":"success","return":[]}

https://mtgox.com/api/1/BTCUSD/public/trades?since=0
Code:
{"result":"success","return":[{"date":1279408157,"price":"0.04951","amount":"20","price_int":"4951","amount_int":"2000000000","tid":"1","price_currency":"USD","item":"BTC","trade_type":"","primary":"Y","properties":"limit"},{"date":1279424586,"price":"0.05941","amount":"50.01","price_int":"5941","amount_int":"5001000000","tid":"2","price_currency":"USD","item":"BTC","trade_type":"","primary":"Y","properties":"limit"},{"date":1279475336,"price":"0.0808","amount":"5","price_int":"8080","amount_int":"500000000","tid":"3","price_currency":"USD","item":"BTC","trade_type":"","primary":"Y","properties":"limit"},
...]}

https://solidcoin24.com/api/trades/btc/s/0
Code:
[{"id":"358","time":"1317002595","rate":"0.0127","amount":"7.79220009"},
{"id":"356","time":"1316972155","rate":"0.01270001","amount":"7.90373468"},
{"id":"354","time":"1316950764","rate":"0.0127","amount":"44.69599152"},
...}]

https://www.worldbitcoinexchange.com/api/getTrades.php
Code:
[{"date": 1316992383, "price": 6.4000, "amount": 3, "tid": 14004},
{"date": 1316993826, "price": 6.2000, "amount": 3.8145, "tid": 14007},
{"date": 1317025563, "price": 6.5000, "amount": 11.74616923, "tid": 14012},
...]

https://x.ruxum.com/api/btc/aud/trades.json
Code:
[]

https://x.ruxum.com/api/btc/chf/trades.json
Code:
[]

https://x.ruxum.com/api/btc/eur/trades.json
Code:
[]

https://x.ruxum.com/api/btc/gbp/trades.json
Code:
[]

https://x.ruxum.com/api/btc/hkd/trades.json
Code:
[{"date":1316313903,"price":"41.0","amount":"3.0","tid":"3676"},
{"date":1316314159,"price":"43.0","amount":"8.0","tid":"3677"},
{"date":1316524748,"price":"46.0","amount":"5.0","tid":"3726"}]

https://x.ruxum.com/api/btc/huf/trades.json
Code:
[]

https://x.ruxum.com/api/btc/jpy/trades.json
Code:
[{"date":1316310790,"price":"390.0","amount":"0.9506","tid":"3672"}]

https://x.ruxum.com/api/btc/pln/trades.json
Code:
[]

https://x.ruxum.com/api/btc/rub/trades.json
Code:
[{"date":1316381062,"price":"159.0","amount":"1.8","tid":"3690"},
{"date":1316381396,"price":"159.0","amount":"0.07107","tid":"3691"},
{"date":1316381397,"price":"169.0","amount":"2.42893","tid":"3692"},
...]

https://x.ruxum.com/api/btc/sek/trades.json
Code:
[]

https://x.ruxum.com/api/btc/sgd/trades.json
Code:
[]

https://x.ruxum.com/api/btc/thb/trades.json
Code:
[]

https://x.ruxum.com/api/btc/uah/trades.json
Code:
[]

https://x.ruxum.com/api/btc/usd/trades.json
Code:
[{"date":1316878080,"price":"5.6","amount":"3.0","tid":"3734"},
{"date":1316946893,"price":"5.6","amount":"0.5084","tid":"3736"},
{"date":1316946946,"price":"5.5","amount":"0.42856","tid":"3737"},
...]

https://x.ruxum.com/api/btc/zar/trades.json
Code:
[{"date":1316189473,"price":"36.9","amount":"2.0","tid":"3642"}]

As a summary, json trade api should contain the following values:

date (unix epoch timestamp)
price/rate
amount/quantity
trade/transaction id

Also see https://bitcointalk.org/index.php?topic=44674
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!