Skip to content

Commit ba1e2c3

Browse files
Added support for Historical Count Endpoint
1 parent 4089df5 commit ba1e2c3

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,19 @@ asset_popularity = client.get_asset_popularity()
447447

448448
### Historical Methods
449449

450+
* [`get_historical_count`](https://developers.shrimpy.io/docs/#get-historical-count)
451+
452+
```python
453+
count = client.get_historical_count(
454+
'trade',
455+
'Bittrex',
456+
'LTC',
457+
'BTC',
458+
'2019-05-19T01:00:00.000Z',
459+
'2019-05-20T02:00:00.000Z'
460+
)
461+
```
462+
450463
* [`get_historical_instruments`](https://developers.shrimpy.io/docs/#get-historical-instruments)
451464

452465
```python

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setuptools.setup(
1515
name="shrimpy_python",
16-
version="0.0.10",
16+
version="0.0.11",
1717
author="ShrimpyOfficial",
1818
author_email="[email protected]",
1919
description="The Official Shrimpy API Python Client",

shrimpy/shrimpy_api_client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,24 @@ def get_historical_instruments(self, exchange=None, base_trading_symbol=None, qu
433433
return self._call_endpoint('GET', query_string)
434434

435435

436+
def get_historical_count(self, data_type, exchange, base_trading_symbol, quote_trading_symbol, start_time, end_time):
437+
endpoint = 'historical/count'
438+
params = {
439+
'type': data_type,
440+
'exchange': exchange,
441+
'baseTradingSymbol': base_trading_symbol,
442+
'quoteTradingSymbol': quote_trading_symbol,
443+
'startTime': start_time,
444+
'endTime': end_time
445+
}
446+
query_string = self._create_query_string(
447+
endpoint,
448+
params
449+
)
450+
451+
return self._call_endpoint('GET', query_string)
452+
453+
436454
##############
437455
# Management #
438456
##############

0 commit comments

Comments
 (0)