pyexchange - Consistent API wrapper for cryptocurrency exchanges.
$ pip install -e git+https://github.com/coderiot/pyexchange.git#egg=pyexchange
- Bitcurex
- Bitfinex
- Bitstamp
- BTCChina
- BTC-e
- CampBX
- Crypto-Trade
- Cryptsy
- Intersango
- Justcoin
- localbitcions
- mtgox
- The Rock Trading
- Bter
- Coins-e
- Vircurex
>>> import pyexchange
>>> pyexchange.exchanges()
example Result:
['bitcurex',
'bitfinex',
'bitstamp',
'btcchina',
'btce',
'campbx',
'cryptotrade',
'cryptsy',
'intersango',
'justcoin',
'localbitcoins',
'mtgox',
'rocktrading']
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox')
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox', 'btc_eur')
>>> import pyexchange
>>> pyexchange.find_market('btc_usd')
>>> import pyexchange
>>> ex = pyexchange.new_exchange('bitfinex')
>>> ex.markets()
or
>>> pyexchange.exchange.bitfinex.markets()
Result:
['ltc_btc', 'ltc_usd', 'btc_usd']
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox')
>>> ex.market = 'btc_eur' # set market
>>> print ex.market # current market
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox')
>>> print ex.ticker()
Result:
Ticker(avg=Decimal('157.19387'), high=Decimal('163.0'), low=Decimal('151.13324'), last=Decimal('160.0'), buy=Decimal('160.00001'), sell=Decimal('160.16'), vol=Decimal('22805.9081')
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox')
>>> asks, bids = ex.depth()
>>> print asks
Result:
[Order(price=Decimal('160.22457'), amount=Decimal('0.01')),
Order(price=Decimal('160.22458'), amount=Decimal('0.12521962')),
Order(price=Decimal('160.29347'), amount=Decimal('1')),
Order(price=Decimal('160.36999'), amount=Decimal('2.56417803')),
Order(price=Decimal('160.37'), amount=Decimal('7.98')),],
...
]
>>> import pyexchange
>>> ex = pyexchange.new_exchange('mtgox')
>>> trades = ex.trades()
>>> print trades
Result:
[Order(price=Decimal('160.22457'), amount=Decimal('0.01')),
Order(price=Decimal('160.22458'), amount=Decimal('0.12521962')),
Order(price=Decimal('160.29347'), amount=Decimal('1')),
Order(price=Decimal('160.36999'), amount=Decimal('2.56417803')),
Order(price=Decimal('160.37'), amount=Decimal('7.98')),
...
]