From ba1e2c3aa8d9dfa2ba0f6aa39947a28b18e8cc1d Mon Sep 17 00:00:00 2001 From: Nishant Nayudu Date: Wed, 6 Nov 2019 13:55:33 -0800 Subject: [PATCH] Added support for Historical Count Endpoint --- README.md | 13 +++++++++++++ setup.py | 2 +- shrimpy/shrimpy_api_client.py | 18 ++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f0fbd10..cb59605 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,19 @@ asset_popularity = client.get_asset_popularity() ### Historical Methods +* [`get_historical_count`](https://developers.shrimpy.io/docs/#get-historical-count) + +```python +count = client.get_historical_count( + 'trade', + 'Bittrex', + 'LTC', + 'BTC', + '2019-05-19T01:00:00.000Z', + '2019-05-20T02:00:00.000Z' +) +``` + * [`get_historical_instruments`](https://developers.shrimpy.io/docs/#get-historical-instruments) ```python diff --git a/setup.py b/setup.py index 27214df..543a6bb 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setuptools.setup( name="shrimpy_python", - version="0.0.10", + version="0.0.11", author="ShrimpyOfficial", author_email="support@shrimpy.io", description="The Official Shrimpy API Python Client", diff --git a/shrimpy/shrimpy_api_client.py b/shrimpy/shrimpy_api_client.py index 6b6f494..f6be2f0 100644 --- a/shrimpy/shrimpy_api_client.py +++ b/shrimpy/shrimpy_api_client.py @@ -433,6 +433,24 @@ def get_historical_instruments(self, exchange=None, base_trading_symbol=None, qu return self._call_endpoint('GET', query_string) + def get_historical_count(self, data_type, exchange, base_trading_symbol, quote_trading_symbol, start_time, end_time): + endpoint = 'historical/count' + params = { + 'type': data_type, + 'exchange': exchange, + 'baseTradingSymbol': base_trading_symbol, + 'quoteTradingSymbol': quote_trading_symbol, + 'startTime': start_time, + 'endTime': end_time + } + query_string = self._create_query_string( + endpoint, + params + ) + + return self._call_endpoint('GET', query_string) + + ############## # Management # ##############