GithubHelp home page GithubHelp logo

wrm3 / pybittrexapiv3.py Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 50 KB

python examples for bittrex api v3

Python 100.00%
bittrex-api-v3-python bittrex bittrex-api bittrex-exchange bittrex-bots v3 trading trading-bot trading-api

pybittrexapiv3.py's Introduction

loc_bittrex_v3.py

This project works with the new Bittrex REST API 3.0.

Bittrex announced that it was retiring the Bittrex API 1.1 in September 2020 (3 months), and encouraged us to switch to the new 3.0 API. I had been using a modified version of ericsomdahl's python-bittrex. My own personal private project (trading bot) which requires this library is going to need a significant overall, and this was just the first step to get that project going... I really am only putting this out there for someone to help get the new GET/HEAD/POST/DELETE with payload concepts figure out. It was a struggle, and what I found online was definitely not helpful.

With the following issues: the "get conditional orders" appears to want the trade symbols reversed to the old order (ie USD-BTC) vs the new Forex style (BTC-USD). I think its a problem on Bittrex end. In addition the old python-bittrex calls are now multiple calls to the new API, so there is no direct correlation so far as Market Summary and Currencies...

I probably should be doing this as a branch of eric somdahls' project, but it doesn't do what his did because of all of the changes, this is just a stepping stone to get my personal project working on the new 3.0 API. I also don't have time to figure out how to use github to properly, this is all fairly rushed. I apologize for not posting this in the correct 'git' way, but from my own fruitless searching I could tell that others are probably in the same boat as me and decided to get it out there. If there wasn't a rampant virus, family health emergencies, and a full time job to deal with, I would have taken the time to do this right. Good Luck. I hope to come back someday and develop this all properly.

I like Bitcoin! Donate BTC: 1NoxcCMCdQoBtC5dprBHxfZDSk1VPWpWFV

pybittrexapiv3.py's People

Contributors

wrm3 avatar

Stargazers

 avatar

Watchers

 avatar

pybittrexapiv3.py's Issues

_private_api_query: Dictionary overwritten

Hi,

First of all thanks for sharing this work!

I have being reviewing this code and noticed that inside "_private_api_query" the code doesn't returns the desired information when the API responds with a list of dictionaries. Specifically line 263 will overwrite the downloaded data with a blank dictionary and afterwards the status_code will be added into it returning only the status_code. I am not sure how to fix it as i can't get which was the way it was originally thought.

		data = r.json()
		print(type(data))
		if isinstance(data, list):
			status_code = r.status_code
			data = dict()
			data['status_code'] = r.status_code
		if isinstance(data, dict):
			data['status_code'] = r.status_code

		return data

The difference on the result is clear when running prv_get_balances() vs prv_get_balances('AnyCoin'):

c = bittrex_api3.prv_get_balances()
print(c)

Result:
def Bittrex.api_query(http_meth=GET, sub_path=/balances, options=null)
request_url                : https://api.bittrex.com/v3/balances
<class 'list'>
{'status_code': 200}

d = bittrex_api3.prv_get_balances('BTC')
print(d)

Result:
def Bittrex.api_query(http_meth=GET, sub_path=/balances/BTC, options=null)
request_url                : https://api.bittrex.com/v3/balances/BTC
<class 'dict'>
{'currencySymbol': 'BTC', 'total': '0.------', 'available': '0.------', 'updatedAt': '2001-01-01T00:00:00Z', 'status_code': 200}

Thanks
LG

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.