ericsomdahl / python-bittrex

Python bindings for bittrex
MIT License
585 stars 283 forks source link

Authenticated calls occasionally return "NO_API_RESPONSE" #151

Open yidkato opened 6 years ago

yidkato commented 6 years ago

This issue was brought up a while ago but closed with no followup.

I'm using this to get the balance after creating an authenticated object: balance = bittrex.get_balance(currency='BTC')['result']['Balance']

When I make the call, I occasionally get the response {'result': None, 'message': 'NO_API_RESPONSE', 'success': False}

This happens about 5% of the time. It successfully returns the balance most of the time. First I thought it was a rate limit issue, so I tried waiting about 15 seconds before making each call, but it still runs into the error. This also happens sometimes (though less often) when I try other calls, like getting ask price for a market.

Can anybody provide some insight?

hamkline commented 6 years ago

Probably an issue with 2.0, older versions won't give me 'NO_API_RESPONSE'

yidkato commented 6 years ago

I'm using v1.1 though

shazrat commented 6 years ago

I'm seeing this as well. I couldn't find an answer so I'm just writing my code to retry if this happens.

Jwdev-wr commented 6 years ago

Ya I have been assuming this is a failure on bittrex to send back the correct data on an API call. It is especially bad when you place an order and get back the NO API RESPONSE but the order goes through.

I have had to account for this, and I honestly still think it is their API. I am no in the transition their websockets but sometimes those close on me for no reason either.

shazrat commented 6 years ago

It is especially bad when you place an order and get back the NO API RESPONSE but the order goes through.

Wow, I forgot that is a potential case. Very unfortunate that such an issue exists.

balint77 commented 6 years ago

I have the same issue with v1.1. Even trade feedback is missing sometimes.

I think one issue is that the python-bittrex just silently swallows what is the real error in bittrex.py/_api_query: ... except Exception: return { 'success': False, 'message': 'NO_API_RESPONSE', 'result': None }

If I add some extra details the real exception in the background is: HTTPSConnectionPool(host='bittrex.com', port=443): Read timed out. (read timeout=10)

So look like Bittrex is not answering at least in this one case.