Need help with python-bittrex?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

ericsomdahl
601 Stars 311 Forks MIT License 76 Commits 44 Opened issues

Description

Python bindings for bittrex

Services available

!
?

Need anything else?

Contributors list

# 82,114
bittrex
cryptoc...
C
C++
18 commits
# 167,860
Python
bittrex
trading...
3 commits
# 177,208
Jupyter...
HTML
CSS
trading...
3 commits
# 213,771
Python
trading...
bittrex
2 commits
# 101,156
trading...
bittrex
Shell
query-l...
2 commits
# 16,013
pandas
MongoDB
cython
nessus
2 commits
# 213,837
Python
trading...
bittrex
2 commits
# 67,716
PHP
Shell
Rust
bittrex
1 commit
# 267,270
C#
trading...
bittrex
HTML
1 commit
# 236,670
Shell
Python
trading...
bittrex
1 commit
# 12,975
JavaScr...
Python
mask-rc...
Keras
1 commit
# 222,439
CSS
HTML
Electro...
Shell
1 commit
# 268,373
C++
C
trading...
bittrex
1 commit
# 74,116
C#
gRPC
HTML
Shell
1 commit
# 131,993
Shell
bittrex
vectori...
Clojure
1 commit
# 270,817
Python
trading...
bittrex
1 commit
# 126,061
CSS
HTML
Shell
trading...
1 commit
# 270,943
Python
trading...
bittrex
1 commit
# 160,880
Crystal
trading...
bittrex
Ada
1 commit
# 270,330
C#
Python
trading...
bittrex
1 commit

python-bittrex

Build Status PyPI version

Python bindings for bittrex. I am Not associated -- use at your own risk, etc.

Installation

for most recent stable release

pip install python-bittrex

for bleeding edge development

pip install git+https://github.com/ericsomdahl/python-bittrex.git

API Documentation

API 1.1 is considered stable

Official API Documentation

API 2.0 is BETA, use at your own risk

Unofficial 2.0 API Documentation - The golang guys have been diligently following the rapid changes to the 2.0 Beta, but use at your own risk.

Example Usage for Bittrex API

from bittrex.bittrex import Bittrex, API_V2_0

my_bittrex = Bittrex(None, None, api_version=API_V2_0) # or defaulting to v1.1 as Bittrex(None, None) my_bittrex.get_markets()

This call to get_markets returns an object such as the following:

{'success': True, 'message': '', 'result': [{'MarketCurrency': 'LTC', ...

APIV20 and APIV11 are constants that can be imported from Bittrex.

To access account methods, an API key for your account is required and can be generated on the

Settings
then
API Keys
page. Make sure you save the secret, as it will not be visible after navigating away from the page.
from bittrex.bittrex import *

my_bittrex = Bittrex("", "", api_version=" or ")

my_bittrex.get_balance('ETH')

This call to get_balance returns an object such as the following:

{'success': True, 
 'message': '',
 'result': {'Currency': 'ETH', 'Balance': 0.0, 'Available': 0.0, 
            'Pending': 0.0, 'CryptoAddress': None}
}

v1.1 constants of interest:

BUY_ORDERBOOK = 'buy'
SELL_ORDERBOOK = 'sell'
BOTH_ORDERBOOK = 'both'

v2.0 constants of interest

These are used by getcandles() ``` TICKINTERVALONEMIN = 'oneMin' TICKINTERVALFIVEMIN = 'fiveMin' TICKINTERVALHOUR = 'hour' TICKINTERVALTHIRTYMIN = 'thirtyMin' TICKINTERVALDAY = 'Day'

these are used by trade_sell() and trade_buy()
ORDERTYPELIMIT = 'LIMIT' ORDERTYPEMARKET = 'MARKET'

TIMEINEFFECTGOODTILCANCELLED = 'GOODTILCANCELLED' TIMEINEFFECTIMMEDIATEORCANCEL = 'IMMEDIATEORCANCEL' TIMEINEFFECTFILLORKILL = 'FILLOR_KILL'

CONDITIONTYPENONE = 'NONE' CONDITIONTYPEGREATERTHAN = 'GREATERTHAN' CONDITIONTYPELESSTHAN = 'LESSTHAN' CONDITIONTYPESTOPLOSSFIXED = 'STOPLOSSFIXED' CONDITIONTYPESTOPLOSSPERCENTAGE = 'STOPLOSS_PERCENTAGE' ```

Testing

In order to run the integration tests, a file called "secrets.json" must be added to the test folder. Structure it as follows, adding your API keys:

{
  "key": "mykey",
  "secret": "mysecret"
}

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.