Title: JSON API for Trades Post by: mizerydearia on September 26, 2011, 08:44:10 PM 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×pan=999999999 Code: {"result":{"errorCode":"OK","data":[{"time":"1303920309","price":"485","vol":"1","tid":"414926"}, http://aqoin.me/bitcoincharts/EUR/trades.php?tid=0 Code: [{"date":1314964052,"price":6.5,"amount":0.4,"tid":1}, https://btcex.com/site/realtimejson/id/2 Code: [{"date":1317065461, "price":4.4986, "amount":62.89, "tid":202380}, http://exchange.bitparking.com:8080/api/t Code: [{"date":"1317064247","price":0.02300300,"amount":1.53212565,"id":"17097"} http://i0exchange.bitparking.com:8080/api/t Code: [{"date":"1317065004","price":0.00050270,"amount":19.00000000,"id":"8376"} http://ixchange.bitparking.com:8080/api/t Code: [{"date":"1317066858","price":0.00118450,"amount":273.61547360,"id":"9522"} http://www.mercadobitcoin.com.br/api/trades/ Code: [{"date":1311859832,"price":23.99000000,"amount":1.00000000,"tid":1}, 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"}, 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"}, https://api.tradehill.com/APIv1/USD/Trades Code: [{"date": 1317056936, "tid": 175906, "price": "4.8910000000", "amount": "0.1100000000"}, https://bitchange.pl/data/trades.json Code: [{"price":"16.49000000","amount":"2.02000000","type":1,"date":1317067386,"tid":5651}, https://bitcoin-central.net/trades.json?currency=CAD Code: [{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"}, https://bitcoin-central.net/trades.json?currency=EUR Code: [{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"}, https://bitcoin-central.net/trades.json?currency=INR Code: [{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"}, https://bitcoin-central.net/trades.json?currency=LREUR Code: [{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"}, https://bitcoin-central.net/trades.json?currency=LRUSD Code: [{"date":1316986527,"price":5.9,"amount":2.0,"currency":"CAD"}, https://bitcoin-central.net/trades.json?currency=PGAU Code: [{"date":1316986527,"price":5.9,"amount":2.0,"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"}, https://bitmarket.eu/api/get_transactions/days:1,currency:GBP Code: [{"date":"1317058561","currency":"GBP","amount":"6.00000000","price":"4.00000000","tx_id":"15555"}, 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"}, https://britcoin.co.uk/api/getTrades.php Code: [{"price":"3.24000","amount":"2.00000","tid":8991,"date":1317067530,"timestamp":"1317067530.98563"}, 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"}, https://campbx.com/api/recenthistory.php?Unixtime=0 Code: [{"Time":1317067152,"Price":"4.97","Bitcoins":"3.00000000","Order ID":"60102"}, https://www.exchangebitcoins.com/data/recent Code: [{"date":1317071595,"price":5.00000000,"amount":0.25,"tid":31490}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, 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"}, https://www.worldbitcoinexchange.com/api/getTrades.php Code: [{"date": 1316992383, "price": 6.4000, "amount": 3, "tid": 14004}, 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"}, 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"}, 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"}, 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 |