Skip to content

Getting Started

Andy Hawkins — (̖̣͕̠̬̭̞̪̐̅ỉ̭̣͈̪̠ͮs̳̳̦̞̰̜̞̳͑͌͋ͪ̃̍ ̩̘́͑ͨ̈́̎̋ͮ͊̀ñ͔̣͓̬̈ͮͦ́ͫ͐͛ͅͅo̩̦̳̠̙̗̯̺̐͆̽t̜̥̻̙̟̼̜͂ͩ͋̅̈́ ̠̦̹̟͕͕̱͉͒͋̅́͐ā̟̻̱ͦ̒̍͋ ̗̞͚ͨͩ͊͂̉ͅh͔̼͚̩͚̪̝̝ͣa̫̫̒̓ͬc̦̲̳͍̹̃ͥͯk̲͕̗̖̤̙̜͍̊e̫͎̟̼̺̫̿r͙̰̊̑̿̅ͯͅ)̪̖͇̝̮̪͖̦͆̇ͧ͑̚ edited this page Nov 27, 2016 · 1 revision

Getting Started

Setup:

Can either be installed a python package.
python setup.py install

Also could easily be setup as a git sub module, as releases are not rolling yet.
git submodule add [email protected]:a904guy/poloniex-python3.git {location}

Credentials:

Some API methods are public, and can be accessed without credentials.
Refer to Poloniex API Documentation to know which require authentication.

Credentials can be passed as a dict, or a ConfigObj,
configObj should contain the same values as the dict below.

PA = PoloniexAPI({'api_key': '', 'secret': ''} || ConfigObj)

For the rest of the document I will be using the PA returned self from PoloniexAPI as the example.

Streaming:

To get the ticker data from the streaming interface, you simply provide the topic "ticker", and a callable object to handle the data received.

def callback(payload):
    """ Manage the data payload sent from the streaming API """
    pass

PA.subscribe('ticker', callback)

To receive order book and trade updates, subscribe to the desired currencyPair, i.e: "BTC_XMR"

For the payload structure of both types of streaming, please refer to Poloniex API Documentation

Rest API:

All of the API Methods are methods inside PA, with their possible param values set in the method for quick code intelligent IDEs.

Their accessed simply by calling their name which match the Poloniex API Documentation exactly. Same with any variables possible to pass along.

ticker = PA.returnTicker()
tradeHistory = PA.returnTradeHistory('BTC_XMR')

All of the API Methods can be found at Poloniex API Documentation

Note: API calls are rate limited to 6 a second per Poloniex's request. Modifying this risks your account being banned.

Clone this wiki locally