<p>So ...it turns out from correspondence with a Bittrex developer that it is currently not possible to get the order history via websockets.</p>

<p>One has to revert to the "normal" public API for this: <a href="https://bittrex.com/home/api" rel="nofollow noreferrer">https://bittrex.com/home/api</a></p>

CC BY-SA 3.0
2018-01-15T19:18:01.277Z
How far back can you retrieve it via API?
Gaia
CC BY-SA 3.0
2018-01-16T09:32:59.390Z
Using _/account/getorderhistory_ you get the latest 200. For _/public/getmarkethistory_ I don't know, I don't use it.
Ytsen de Boer
CC BY-SA 3.0
2017-11-09T12:57:54.257Z
2017-11-09T12:57:54.257Z
Ytsen de Boer
<p>Using the Bittrex websockets API I am able to get the summary updates for all markets and also the exchange updates for specific markets.</p>

<p>However, I am not able to receive the order <em>history</em> (as opposed to updates).</p>

<p>The market exchange updates are regularly received after invoking the hub method: "SubscribeToExchangeDeltas".</p>

<p>I am trying to get the order history via invoking the hub method: "QueryExchangeState".</p>

<p>But this does not seem to work and I don't get an error either ... ?</p>

<p>Does anyone have experience with this or has the same problem or knows a nifty trick, please let me know!</p>

<p>The code I am using is like so:</p>

<pre><code>import pprint
from requests import Session  # pip install requests
from signalr import Connection  # pip install signalr-client


def handle_received(*args, **kwargs):

    print('\nreceived')
    print('\nargs:')
    pprint.pprint(args)
    print('\nkwargs:')
    pprint.pprint(kwargs)


def print_error(error):
    print('error: ', error)


def main():
    with Session() as session:
        connection = Connection("https://www.bittrex.com/signalR/", session)
        chat = connection.register_hub('corehub')
        connection.start()

        connection.received += handle_received
        connection.error += print_error

        for market in ["BTC-MEME"]:
            chat.server.invoke('SubscribeToExchangeDeltas', market)
            chat.server.invoke('QueryExchangeState', market)
            pass

        while True:
            connection.wait(1)

if __name__ == "__main__":
    main()
</code></pre>

<trading><python>
Bittrex websockets: How to get the order history?
Ytsen de Boer
# Bittrex websockets: How to get the order history?

(Asked by: username_0 on 2017-11-04)

Using the Bittrex websockets API I am able to get the summary updates for all markets and also the exchange updates for specific markets.
However, I am not able to receive the order history (as opposed to updates).
The market exchange updates are regularly received after invoking the hub method: "SubscribeToExchangeDeltas".
I am trying to get the order history via invoking the hub method: "QueryExchangeState".
But this does not seem to work and I don't get an error either ... ?
Does anyone have experience with this or has the same problem or knows a nifty trick, please let me know!
The code I am using is like so:
import pprint
from requests import Session  # pip install requests
from signalr import Connection  # pip install signalr-client


def handle_received(*args, **kwargs):

    print('\nreceived')
    print('\nargs:')
    pprint.pprint(args)
    print('\nkwargs:')
    pprint.pprint(kwargs)


def print_error(error):
    print('error: ', error)


def main():
    with Session() as session:
        connection = Connection("https://www.bittrex.com/signalR/", session)
        chat = connection.register_hub('corehub')
        connection.start()

        connection.received += handle_received
        connection.error += print_error

        for market in ["BTC-MEME"]:
            chat.server.invoke('SubscribeToExchangeDeltas', market)
            chat.server.invoke('QueryExchangeState', market)
            pass

        while True:
            connection.wait(1)

if __name__ == "__main__":
    main()

**Tags:** trading, python


---

## 1 answers

### Answer by username_0 on 2017-11-09. Score: 0 | Accepted answer

So ...it turns out from correspondence with a Bittrex developer that it is currently not possible to get the order history via websockets.

One has to revert to the "normal" public API for this: <https://bittrex.com/home/api>

> **Comments:**
> **username_1**: How far back can you retrieve it via API?  
> **username_0**: Using _/account/getorderhistory_ you get the latest 200. For _/public/getmarkethistory_ I don't know, I don't use it.  

---

