Skip to content

Commit

Permalink
Merge pull request man-c#18 from mfiro/add_get_coins_ohlc_by_id
Browse files Browse the repository at this point in the history
Added /coins/{id}/ohlc endpoint
  • Loading branch information
man-c authored Sep 26, 2020
2 parents 53286df + 6f57cde commit 33df2f1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pycoingecko/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ def get_coin_status_updates_by_id(self, id, **kwargs):
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

@list_args_to_comma_separated
def get_coin_ohlc_by_id(self, id, vs_currency, days, **kwargs):
"""Get coin's OHLC"""

api_url = '{0}coins/{1}/ohlc?vs_currency={2}&days={3}'.format(self.api_base_url, id, vs_currency, days)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

# ---------- Contract ----------#
@list_args_to_comma_separated
Expand Down

0 comments on commit 33df2f1

Please sign in to comment.