Bittrex

Get currencies

ccs.bittrex.public.getCurrencies()

This function provide informations about available currencies.

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

TODO

Key Description
Currency  
CurrencyLong  
MinConfirmation  
TxFee  
IsActive  
CoinType  
BaseAddress  
Notice  

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getCurrencies()
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            [
                {
                    "Currency":"BTC",
                    "CurrencyLong":"Bitcoin",
                    "MinConfirmation":2,
                    "TxFee":0.00020000,
                    "IsActive":true,
                    "CoinType":"BITCOIN",
                    "BaseAddress":null,
                    "Notice":null
                },
                {
                    "Currency":"LTC",
                    "CurrencyLong":"Litecoin",
                    "MinConfirmation":6,
                    "TxFee":0.00200000,
                    "IsActive":true,
                    "CoinType":"BITCOIN",
                    "BaseAddress":null,
                    "Notice":null
                },
                ...
            ]
}
>>>
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getcurrencies"]

Note

This function use REST endpoint which is described on Bittrex documentation.

Example of GET request:

Get markets

ccs.bittrex.public.getMarkets()

This function provide informations about available marktets.

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

TODO

Key Description
MarketCurrency  
BaseCurrency  
MarketCurrencyLong  
BaseCurrencyLong  
MinTradeSize  
MarketName  
IsActive  
Created  
Notice  
IsSponsored  
LogoUrl  

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getMarkets()
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            [
                {
                    "MarketCurrency":"LTC",
                    "BaseCurrency":"BTC",
                    "MarketCurrencyLong":"Litecoin",
                    "BaseCurrencyLong":"Bitcoin",
                    "MinTradeSize":0.00000001,
                    "MarketName":"BTC-LTC",
                    "IsActive":true,
                    "Created":"2014-02-13T00:00:00",
                    "Notice":null,
                    "IsSponsored":null,
                    "LogoUrl":"https://i.imgur.com/R29q3dD.png"
                },
                {
                    "MarketCurrency":"DOGE",
                    "BaseCurrency":"BTC",
                    "MarketCurrencyLong":"Dogecoin",
                    "BaseCurrencyLong":"Bitcoin",
                    "MinTradeSize":0.00000001,
                    "MarketName":"BTC-DOGE",
                    "IsActive":true,
                    "Created":"2014-02-13T00:00:00",
                    "Notice":null,
                    "IsSponsored":null,
                    "LogoUrl":"https://i.imgur.com/e1RS4Hn.png"
                },
                ...
            ]
}
>>>
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getMarkets"]

Note

This function use REST endpoint which is described on Bittrex documentation.

Example of GET request:

Get market history

ccs.bittrex.public.getMarketHistory(market, count=20)

This function provide history of trades.

Parameters:
  • market (String) – Market is currency pair. For more information about markets (symbols) visit getmarkets() or getcurrencies().
  • count (Interger) –

    It define maximum number of trades. This argument is optional. Default value is 20. Max is 50.

    Warning

    Count argument is mentioned in official documentation, but server absolutely ignore this value.

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

TODO

Key Description
Id  
TimeStamp  
Quantity  
Price  
Total  
FillType  
OrderType  

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getMarketHistory("btc-ltc")
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            [
                {
                    "Id":4126151,
                    "TimeStamp":"2017-01-09T12:32:18.377",
                    "Quantity":66597.09000000,
                    "Price":0.00000025,
                    "Total":0.01664927,
                    "FillType":"FILL",
                    "OrderType":"BUY"
                },
                {
                    "Id":4126114,
                    "TimeStamp":"2017-01-09T12:25:54.06",
                    "Quantity":23467.20827500,
                    "Price":0.00000024,
                    "Total":0.00563212,
                    "FillType":"PARTIAL_FILL",
                    "OrderType":"SELL"
                }
            ]
}
>>>
>>> # Other examples of using
>>> ccs.bittrex.public.getMarketHistory("btc-ltc", count=5)
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getMarketHistory"]

Get market summary

ccs.bittrex.public.getMarketSummary(market)

This function provide detailed data of give market. This informations offer high level overview of the current states on the market. It is actual price, best bids and asks etc.

Parameters:

market (String) – Market is currency pair. For more information about markets (symbols) visit getmarkets() or getcurrencies().

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

Key Description
MarketName ?
High ?
Low ?
Volume ?
Last ?
BaseVolume ?
TimeStamp ?
Bid ?
Ask ?
OpenBuyOrders ?
OpenSellOrders ?
PrevDay ?
Created ?
DisplayMarketName ?

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getMarketSummary("btc-ltc")
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            [
                {
                    "MarketName":"BTC-LTC",
                    "High":0.00454888,
                    "Low":0.00423000,
                    "Volume":1598.24416057,
                    "Last":0.00436820,
                    "BaseVolume":6.99532215,
                    "TimeStamp":"2017-01-08T14:17:11.43",
                    "Bid":0.00437737,
                    "Ask":0.00440629,
                    "OpenBuyOrders":170,
                    "OpenSellOrders":859,
                    "PrevDay":0.00448802,
                    "Created":"2014-02-13T00:00:00"
                }
            ]
}
>>>
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getMarketSummary"]

Note

This function use REST endpoint which is described on Bittrex documentation.

Example of GET request:

Get market summaries

ccs.bittrex.public.getMarketSummaries()

This function provide detailed data of all markets. This informations offer high level overview of the current states on the market. It is actual price, best bids and asks etc.

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

Key Description
MarketName ?
High ?
Low ?
Volume ?
Last ?
BaseVolume ?
TimeStamp ?
Bid ?
Ask ?
OpenBuyOrders ?
OpenSellOrders ?
PrevDay ?
Created ?
DisplayMarketName ?

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getMarketSummaries()
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            [
                {
                    "MarketName":"BITCNY-BTC",
                    "High":6000.00000001,
                    "Low":6000.00000001,
                    "Volume":0.00000020,
                    "Last":6000.00000001,
                    "BaseVolume":0.00120000,
                    "TimeStamp":"2017-01-09T13:19:54.15",
                    "Bid":6000.00000001,
                    "Ask":59000.00000000,
                    "OpenBuyOrders":15,
                    "OpenSellOrders":14,
                    "PrevDay":6000.00000001,
                    "Created":"2015-12-11T06:31:40.653"
                },
                {
                    "MarketName":"BTC-2GIVE",
                    "High":0.00000049,
                    "Low":0.00000038,
                    "Volume":36247.97622366,
                    "Last":0.00000038,
                    "BaseVolume":0.01447996,
                    "TimeStamp":"2017-01-09T13:29:46.937",
                    "Bid":0.00000039,
                    "Ask":0.00000043,
                    "OpenBuyOrders":52,
                    "OpenSellOrders":394,
                    "PrevDay":0.00000049,
                    "Created":"2016-05-16T06:44:15.287"
                },
                ...
            ]
}
>>>
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getMarketSummaries"]

Note

This function use REST endpoint which is described on Bittrex documentation.

Example of GET request:

Get orderbook

ccs.bittrex.public.getOrderbook(market, depth=20, type='both')

This function provide actual lists of orders for sell and buy.

Parameters:
  • market (String) – Market is currency pair. For more information about markets (symbols) visit getmarkets() or getcurrencies().
  • depth (Integer) –

    It define maximum number of asks / bids. This argument is optional. Default value is 20.

    Warning

    Depth argument is mentioned in official documentation, but server absolutely ignore this value.

  • type (String) –

    This argument identify type of orderbook. Available values are:

    • sell
    • buy
    • both

    This argument is optional. Default value is “both”.

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

TODO

Key Description
Quantity  
Rate  

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getOrderbook("btc-ltc")
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
            {
                "buy":
                    [
                        {"Quantity":0.12415465,"Rate":0.00437001},
                        {"Quantity":3.58852516,"Rate":0.00435273},
                        ...
                    ],
                "sell":
                    [
                        {"Quantity":41.83912609,"Rate":0.00440900},
                        {"Quantity":2.51315302,"Rate":0.00440904},
                        ...
                    ]
            }
}
>>>
>>> # Other examples of using
>>> ccs.bittrex.public.getOrderbook("btc-ltc", depth=30)
>>> ccs.bittrex.public.getOrderbook("btc-ltc", type="sell")
>>> ccs.bittrex.public.getOrderbook("btc-ltc", type="buy")
>>> ccs.bittrex.public.getOrderbook("btc-ltc", depth=10, type="buy")
>>>
>>> # Prepared validation schema !! TYPE = BOTH
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getOrderbook"]
>>> # Prepared validation schema !! TYPE = BUY or TYPE=SELL
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getOrderbookBuySell"]

Get ticker

ccs.bittrex.public.getTicker(market)
This function provide tick data. This informations offer high level overview.
Parameters:

market (String) – Market is currency pair. For more information about markets (symbols) visit getmarkets() or getcurrencies().

Returns:

The function return payload of http response. It is string which contains json object. Official description of keys is in the table.

Key Description
Bid  
Ask  
Last  

Return type:

String

Exception:

It can raise any exception which can occur during using

  • http.client.HTTPSConnection
  • http.client.HTTPSConnection.request().
Example:
>>> import ccs
>>> response = ccs.bittrex.public.getTicker("btc-ltc")
>>> print(response)
{
    "success":true,
    "message":"",
    "result":
        {
            "Bid":0.00436403,
            "Ask":0.00441773,
            "Last":0.00441777
        }
}
>>>
>>> # Prepared validation schema
>>> schema = ccs.cfg.schema[ccs.constants.BITTREX]["getTicker"]

Note

This function use REST endpoint which is described on Bittrex documentation.

Example of GET request: