Post
Topic
Board Exchanges
Re: python poloniex API to see my last trades
by
s4w3d0ff
on 10/04/2017, 20:22:35 UTC
Code:
pip install git+https://github.com/s4w3d0ff/python-polonix.git --user
Seems to be working for me. returnTradeHistory should return your trade history, while marketTradeHist will return everyones trades for the market
Code:
from poloniex import Poloniex
polo = Poloniex('api-key-here', 'supersecrethashhere123')
# your trades
polo.returnTradeHistory()
Quote
{u'BTC_VTC': [{u'category': u'exchange', u'fee': u'0.00150000', u'tradeID': u'446971', u'orderNumber': u'5138465491', u'amount': u'1109.44444445', u'rate': u'0.00017200', u'date': u'2017-04-10 09:41:31', u'total': u'0.19082444', u'type': u'sell', u'globalTradeID': u'103263644'}, {u'category': u'exchange', u'fee': u'0.00150000', u'tradeID': u'429065', u'orderNumber': u'5067638389', u'amount': u'1111.11111111', u'rate': u'0.00009000', u'date': u'2017-04-10 04:49:27', u'total': u'0.09999999', u'type': u'buy', u'globalTradeID': u'103163970'}, {u'category': u'exchange', u'fee': u'0.00150000', u'tradeID': u'428121', u'orderNumber': u'5016845233', u'amount': u'2283.95409345', u'rate': u'0.00011000', u'date': u'2017-04-10 04:32:59', u'total': u'0.25123495', u'type': u'sell', u'globalTradeID': u'103159723'}]}
Code:
# market trades
polo.marketTradeHist('BTC_VTC')
Quote
[{u'tradeID': u'481386', u'amount': u'21.88995030', u'rate': u'0.00015493', u'date': u'2017-04-10 20:11:23', u'total': u'0.00339140', u'type': u'buy', u'globalTradeID': u'103517907'},,,,]