Skip to content

Commit

Permalink
Upgrade price history API (day, hour, minute)
Browse files Browse the repository at this point in the history
  • Loading branch information
YiruJeon committed Feb 2, 2022
1 parent 8cc038e commit 932a2c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cryptocompare/cryptocompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
_URL_PRICE_MULTI = 'https://min-api.cryptocompare.com/data/pricemulti?fsyms={}&tsyms={}'
_URL_PRICE_MULTI_FULL = 'https://min-api.cryptocompare.com/data/pricemultifull?fsyms={}&tsyms={}'
_URL_HIST_PRICE = 'https://min-api.cryptocompare.com/data/pricehistorical?fsym={}&tsyms={}&ts={}&e={}'
_URL_HIST_PRICE_DAY = 'https://min-api.cryptocompare.com/data/histoday?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_HIST_PRICE_HOUR = 'https://min-api.cryptocompare.com/data/histohour?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_HIST_PRICE_MINUTE = 'https://min-api.cryptocompare.com/data/histominute?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_HIST_PRICE_DAY = 'https://min-api.cryptocompare.com/data/v2/histoday?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_HIST_PRICE_HOUR = 'https://min-api.cryptocompare.com/data/v2/histohour?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_HIST_PRICE_MINUTE = 'https://min-api.cryptocompare.com/data/v2/histominute?fsym={}&tsym={}&limit={}&e={}&toTs={}'
_URL_AVG = 'https://min-api.cryptocompare.com/data/generateAvg?fsym={}&tsym={}&e={}'
_URL_EXCHANGES = 'https://www.cryptocompare.com/api/data/exchanges?'
_URL_PAIRS = 'https://min-api.cryptocompare.com/data/pair/mapping/exchange?e={}'
Expand Down Expand Up @@ -161,7 +161,7 @@ def get_historical_price_day(coin: str, currency: str = CURRENCY, limit: int = L
response = _query_cryptocompare(
_URL_HIST_PRICE_DAY.format(coin, _format_parameter(currency), limit, exchange, _format_timestamp(toTs)))
if response:
return response['Data']
return response['Data']['Data']
return None


Expand All @@ -181,7 +181,7 @@ def get_historical_price_hour(coin: str, currency: str = CURRENCY, limit: int =
response = _query_cryptocompare(
_URL_HIST_PRICE_HOUR.format(coin, _format_parameter(currency), limit, exchange, _format_timestamp(toTs)))
if response:
return response['Data']
return response['Data']['Data']
return None


Expand All @@ -200,7 +200,7 @@ def get_historical_price_minute(coin: str, currency: str = CURRENCY, limit: int
response = _query_cryptocompare(
_URL_HIST_PRICE_MINUTE.format(coin, _format_parameter(currency), limit, exchange, _format_timestamp(toTs)))
if response:
return response['Data']
return response['Data']['Data']
return None


Expand Down

0 comments on commit 932a2c2

Please sign in to comment.