Skip to content

Commit

Permalink
Added asset_platforms (/asset_platforms) and categories (/coins/categ…
Browse files Browse the repository at this point in the history
…ories/list, coins/categories) endpoints
  • Loading branch information
man-c committed May 18, 2021
1 parent 0259453 commit 846e72c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ https://www.coingecko.com/api/docs/v3
```python
cg.get_coin_market_chart_range_from_contract_address_by_id()
```
- *asset_platforms*
- **/asset_platforms** (List all asset platforms (Blockchain networks))
```python
cg.get_asset_platforms()
```
- *categories*
- **/coins/categories/list** (List all categories)
```python
cg.get_coins_categories_list()
```
- **coins/categories** (List all categories with market data)
```python
cg.get_coins_categories()
```
- *exchanges (beta)*
- **/exchanges** (List all exchanges)
```python
Expand Down
29 changes: 29 additions & 0 deletions pycoingecko/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,35 @@ def get_coin_market_chart_range_from_contract_address_by_id(self, id, contract_a

return self.__request(api_url)

# ---------- ASSET PLATFORMS ----------#
@func_args_preprocessing
def get_asset_platforms(self, **kwargs):
"""List all asset platforms (Blockchain networks)"""

api_url = '{0}asset_platforms'.format(self.api_base_url)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

# ---------- CATEGORIES ----------#
@func_args_preprocessing
def get_coins_categories_list(self, **kwargs):
"""List all categories"""

api_url = '{0}coins/categories/list'.format(self.api_base_url)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

@func_args_preprocessing
def get_coins_categories(self, **kwargs):
"""List all categories with market data"""

api_url = '{0}coins/categories'.format(self.api_base_url)
api_url = self.__api_url_params(api_url, kwargs)

return self.__request(api_url)

# ---------- EXCHANGES ----------#
@func_args_preprocessing
def get_exchanges_list(self, **kwargs):
Expand Down

0 comments on commit 846e72c

Please sign in to comment.