Skip to content

Commit

Permalink
Added support for Historical Count Endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-shrimpy committed Nov 6, 2019
1 parent 4089df5 commit ba1e2c3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setuptools.setup(
name="shrimpy_python",
version="0.0.10",
version="0.0.11",
author="ShrimpyOfficial",
author_email="[email protected]",
description="The Official Shrimpy API Python Client",
Expand Down
18 changes: 18 additions & 0 deletions shrimpy/shrimpy_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
##############
Expand Down

0 comments on commit ba1e2c3

Please sign in to comment.