# CoinGecko API wrapper
[![PyPi Version](https://img.shields.io/pypi/v/pycoingecko.svg)](https://pypi.python.org/pypi/pycoingecko/)
![GitHub](https://img.shields.io/github/license/man-c/pycoingecko)
Python3 wrapper around the [CoinGecko](https://www.coingecko.com/) API (V3) ๐ฆ<br> Supports both Public and Pro API:
* [Public API v3.0.1](https://docs.coingecko.com/v3.0.1/reference/introduction)
* [Pro API v3.1.1](https://docs.coingecko.com/v3.1.1/reference/introduction)
### Installation
PyPI
```bash
pip install -U pycoingecko
```
or from source
```bash
git clone https://github.com/man-c/pycoingecko.git
cd pycoingecko
python3 setup.py install
```
### Usage
For free **Public API**:
* without any demo api key (x-cg-demo-api-key):
```python
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
```
* ๐ with a <ins>demo api key</ins>:
```python
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI(demo_api_key='YOUR_DEMO_API_KEY')
```
For **Pro API**:
* ๐ with a <ins>pro api key</ins>:
```python
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI(api_key='YOUR_PRO_API_KEY')
```
### Examples
The required parameters for each endpoint are defined as required (mandatory) parameters for the corresponding functions.\
**Any optional parameters** can be passed using same names, as defined in CoinGecko API doc (https://www.coingecko.com/en/api/documentation).
For any parameter:
- ***Lists** are supported as input for multiple-valued comma-separated parameters\
(e.g. see /simple/price usage examples).*
- ***Booleans** are supported as input for boolean type parameters; they can be `str` ('true', 'false'') or `bool` (`True`, `False`)\
(e.g. see /simple/price usage examples).*
Usage examples:
```python
# /simple/price endpoint with the required parameters
>>> cg.get_price(ids='bitcoin', vs_currencies='usd')
{'bitcoin': {'usd': 3462.04}}
>>> cg.get_price(ids='bitcoin,litecoin,ethereum', vs_currencies='usd')
# OR (lists can be used for multiple-valued arguments)
>>> cg.get_price(ids=['bitcoin', 'litecoin', 'ethereum'], vs_currencies='usd')
{'bitcoin': {'usd': 3461.27}, 'ethereum': {'usd': 106.92}, 'litecoin': {'usd': 32.72}}
>>> cg.get_price(ids='bitcoin,litecoin,ethereum', vs_currencies='usd,eur')
# OR (lists can be used for multiple-valued arguments)
>>> cg.get_price(ids=['bitcoin', 'litecoin', 'ethereum'], vs_currencies=['usd', 'eur'])
{'bitcoin': {'usd': 3459.39, 'eur': 3019.33}, 'ethereum': {'usd': 106.91, 'eur': 93.31}, 'litecoin': {'usd': 32.72, 'eur': 28.56}}
# optional parameters can be passed as defined in the API doc (https://www.coingecko.com/api/docs/v3)
>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap='true', include_24hr_vol='true', include_24hr_change='true', include_last_updated_at='true')
{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}
# OR (also booleans can be used for boolean type arguments)
>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap=True, include_24hr_vol=True, include_24hr_change=True, include_last_updated_at=True)
{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}
```
### API documentation
https://www.coingecko.com/en/api/documentation
### ๐ก Endpoints included
> :warning: **Endpoints documentation**: To make sure that you are using properly each endpoint you should check the [API documentation](https://www.coingecko.com/en/api/documentation). Return behaviour and parameters of the endpoints, such as *pagination*, might have changed. <br> Any **optional parameters** defined in CoinGecko API doc can be passed as function parameters using same parameters names with the API *(see Examples above)*.
<details><summary>ping</summary>
<p>
* **/ping**
_Check API server status_
```python
cg.ping()
```
</details>
<details><summary>key</summary>
<p>
* [Pro API] ๐ผ **/key**
_Monitor your account's API usage, including rate limits, monthly total credits, remaining credits, and more_
```python
cg.key()
```
</details>
<details><summary>simple</summary>
<p>
* **/simple/price**
_Get the current price of any cryptocurrencies in any other supported currencies that you need_
```python
cg.get_price()
```
* **/simple/token_price/{id}**
_Get current price of tokens (using contract addresses) for a given platform in any other currency that you need_
```python
cg.get_token_price()
```
* **/simple/supported_vs_currencies**
_Get list of supported_vs_currencies_
```python
cg.get_supported_vs_currencies()
```
</details>
<details><summary>coins</summary>
<p>
* **/coins/list**
_List all supported coins id, name and symbol (no pagination required)_
```python
cg.get_coins_list()
```
* [Pro API] ๐ผ **/coins/top_gainers_losers**
_Query the top 30 coins with largest price gain and loss by a specific time duration_
```python
cg.get_coin_top_gainers_losers()
```
* [Pro API] ๐ผ **/coins/list/new**
_Query the latest 200 coins that recently listed on CoinGecko_
```python
cg.get_coins_list_new()
```
* **/coins/markets**
_List all supported coins price, market cap, volume, and market related data_
```python
cg.get_coins_markets()
```
* **/coins/{id}**
_Get current data (name, price, market, ... including exchange tickers) for a coin_
```python
cg.get_coin_by_id()
```
* **/coins/{id}/tickers**
_Get coin tickers (paginated to 100 items)_
```python
cg.get_coin_ticker_by_id()
```
* **/coins/{id}/history**
_Get historical data (name, price, market, stats) at a given date for a coin_
```python
cg.get_coin_history_by_id()
```
* **/coins/{id}/market_chart**
_Get historical market data include price, market cap, and 24h volume (granularity auto)_
```python
cg.get_coin_market_chart_by_id()
```
* **/coins/{id}/market_chart/range**
_Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto)_
```python
cg.get_coin_market_chart_range_by_id()
```
[//]: # (* **/coins/{id}/status_updates** (Get status updates for a given coin (beta)))
[//]: # ( ```python)
[//]: # ( cg.get_coin_status_updates_by_id())
[//]: # ( ```)
* **/coins/{id}/ohlc**
_Get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin id_
```python
cg.get_coin_ohlc_by_id()
```
* [Pro API] ๐ผ **/coins/{id}/ohlc/range**
_Get the OHLC chart (Open, High, Low, Close) of a coin within a range of timestamp based on particular coin id_
```python
cg.get_coin_ohlc_by_id_range()
```
* [Pro API] ๐ **/coins/{id}/circulating_supply_chart**
_Query historical circulating supply of a coin by number of days away from now based on provided coin id_
```python
cg.get_coin_circulating_supply_chart()
```
* [Pro API] ๐ **/coins/{id}/circulating_supply_chart/range**
_Query historical circulating supply of a coin, within a range of timestamp based on the provided coin id_
```python
cg.get_coin_circulating_supply_chart_range()
```
* [Pro API] ๐ **/coins/{id}/total_supply_chart**
_Query historical total supply of a coin by number of days away from now based on provided coin id_
```python
cg.get_coin_total_supply_chart()
```
* [Pro API] ๐ **/coins/{id}/total_supply_chart/range**
_Query historical total supply of a coin, within a range of timestamp based on the provided coin id_
```python
cg.get_coin_total_supply_chart_range()
```
</details>
<details><summary>contract</summary>
<p>
* **/coins/{id}/contract/{contract_address}**
_Get coin info from contract address_
```python
cg.get_coin_info_from_contract_address_by_id()
```
* **/coins/{id}/contract/{contract_address}/market_chart/**
_Get historical market data include price, market cap, and 24h volume (granularity auto) from a contract address_
```python
cg.get_coin_market_chart_from_contract_address_by_id()
```
* **/coins/{id}/contract/{contract_address}/market_chart/range**
_Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto) from a contract address_
```python
cg.get_coin_market_chart_range_from_contract_address_by_id()
```
</details>
<details><summary>asset_platforms</summary>
<p>
* **/asset_platforms**
_List all asset platforms (Blockchain networks)_
```python
cg.get_asset_platforms()
```
* [Pro API] ๐ **/token_lists/{asset_platform_id}/all.json**
_Get full list of tokens of a blockchain network (asset platform) that is supported by Ethereum token list standard_
```python
cg.get_asset_platform_by_id()
```
</details>
<details><summary>categories</summary>
<p>
* **/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()
```
</details>
<details><summary>exchanges</summary>
<p>
* **/exchanges**
_List all exchanges_
```python
cg.get_exchanges_list()
```
* **/exchanges/list**
_List all supported markets id and name (no pagination required)_
```python
cg.get_exchanges_id_name_list()
```
* **/exchanges/{id}**
_Get exchange volume in BTC and top 100 tickers only_
```python
cg.get_exchanges_by_id()
```
* **/exchanges/{id}/tickers**
_Get exchange tickers (paginated, 100 tickers per page)_
```python
cg.get_exchanges_tickers_by_id()
```
[//]: # (* **/exchanges/{id}/status_updates** (Get status updates for a given exchange (beta)))
[//]: # ( ```python)
[//]: # ( cg.get_exchanges_status_updates_by_id())
[//]: # ( ```)
* **/exchanges/{id}/volume_chart**
_Get volume_chart data for a given exchange_
```python
cg.get_exchanges_volume_chart_by_id()
```
* [Pro API] ๐ผ **/exchanges/{id}/volume_chart/range**
_Query the historical volume chart data in BTC by specifying date range in UNIX based on exchangeโs id_
```python
cg.get_exchanges_volume_chart_by_id_within_time_range()
```
</details>
[//]: # (<details><summary>finance</summary>)
[//]: # (<p>)
[//]: # ()
[//]: # (* **/finance_platforms** (List all finance platforms))
[//]: # ( ```python)
[//]: # ( cg.get_finance_platforms())
[//]: # ( ```)
[//]: # (* **/finance_products** (List all finance products))
[//]: # ( ```python)
[//]: # ( cg.get_finance_products())
[//]: # ( ```)
[//]: # (</details>)
<details><summary>indexes</summary>
<p>
* **/indexes**
_List all market indexes_
```python
cg.get_indexes()
```
* **/indexes/{market_id}/{id}**
_Get market index by market id and index id_
```python
cg.get_indexes_by_market_id_and_index_id()
```
* **/indexes/list**
_List market indexes id and name_
```python
cg.get_indexes_list()
```
</details>
<details><summary>derivatives</summary>
<p>
* **/derivatives**
_List all derivative tickers_
```python
cg.get_derivatives()
```
* **/derivatives/exchanges**
_List all derivative exchanges_
```python
cg.get_derivatives_exchanges()
```
* **/derivatives/exchanges/{id}**
_Show derivative exchange data_
```python
cg.get_derivatives_exchanges_by_id()
```
* **/derivatives/exchanges/list**
_List all derivative exchanges name and identifier_
```python
cg.get_derivatives_exchanges_list()
```
</details>
<details><summary>nfts (beta)</summary>
<p>
* **/nfts/list**
_List all supported NFT ids, paginated by 100 items per page, paginated to 100 items_
```python
cg.get_nfts_list()
```
* **/nfts/{id}**
_Get current data (name, price_floor, volume_24h ...) for an NFT collection. native_currency (string) is only a representative of the currency_
```python
cg.get_nfts_by_id()
```
* **/nfts/{asset_platform_id}/contract/{contract_address}**
_Get current data (name, price_floor, volume_24h ...) for an NFT collection. native_currency (string) is only a representative of the currency_
```python
cg.get_nfts_collection_by_asset_platform_id_and_contract_address()
```
* [Pro API] ๐ผ **/nfts/markets**
_Query all the supported NFT collections with floor price, market cap, volume and market related data on CoinGecko_
```python
cg.get_nfts_markets()
```
* [Pro API] ๐ผ **/nfts/{id}/market_chart**
_Query historical market data of a NFT collection, including floor price, market cap, and 24h volume, by number of days away from now_
```python
cg.get_nfts_market_chart_by_id()
```
* [Pro API] ๐ผ **/nfts/{asset_platform_id}/contract/{contract_address}/market_chart**
_Query historical market data of a NFT collection, including floor price, market cap, and 24h volume, by number of days away from now based on the provided contract address_
```python
cg.get_ntfs_market_chart_by_asset_platform_id_and_contract_address()
```
* [Pro API] ๐ผ **/nfts/{id}/tickers**
_Query the latest floor price and 24h volume of a NFT collection, on each NFT marketplace, e.g. OpenSea and LooksRare_
```python
cg.get_nfts_tickers_by_id()
```
</details>
[//]: # (<details><summary>status_updates</summary>)
[//]: # (<p>)
[//]: # ()
[//]: # (* **/status_updates** (List all status_updates with data (description, category, created_at, user, user_title and pin)))
[//]: # ( ```python)
[//]: # ( cg.get_status_updates())
[//]: # ( ```)
[//]: # (</details>)
[//]: # (<details><summary>events</summary>)
[//]: # (<p>)
[//]: # ()
[//]: # (* **/events** (Get events, paginated by 100))
[//]: # ( ```python)
[//]: # ( cg.get_events())
[//]: # ( ```)
[//]: # (* **/events/countries** (Get list of event countries))
[//]: # ( ```python)
[//]: # ( cg.get_events_countries())
[//]: # ( ```)
[//]: # (* **/events/types** (Get list of events types))
[//]: # ( ```python)
[//]: # ( cg.get_events_types())
[//]: # ( ```)
[//]: # (</details>)
<details><summary>exchange_rates</summary>
<p>
* **/exchange_rates**
_Get BTC-to-Currency exchange rates_
```python
cg.get_exchange_rates()
```
</details>
<details><summary>search</summary>
<p>
* **/search**
_Search for coins, categories and markets on CoinGecko_
```python
cg.search()
```
</details>
<details><summary>trending</summary>
<p>
* **/search/trending**
_Get trending search coins (Top-7) on CoinGecko in the last 24 hours_
```python
cg.get_search_trending()
```
</details>
<details><summary>global</summary>
<p>
* **/global**
_Get cryptocurrency global data_
```python
cg.get_global()
```
* **/global/decentralized_finance_defi**
_Get cryptocurrency global decentralized finance(defi) data_
```python
cg.get_global_decentralized_finance_defi()
```
* [Pro API] ๐ผ **/global/market_cap_chart**
_Query historical global market cap and volume data by number of days away from now)_
```python
cg.get_global_market_cap_chart()
```
</details>
<details><summary>companies (beta)</summary>
<p>
* **/companies/public_treasury/{coin_id}**
_Query public companiesโ bitcoin or ethereum holdings_
```python
cg.get_companies_public_treasury_by_coin_id()
```
</details>
### Test
#### Installation
Install required packages for testing using:
```bash
pip install pytest responses
```
#### Usage
Run unit tests with:
```
# after installing pytest and responses using pip3
pytest tests
```
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": "https://github.com/man-c/pycoingecko",
"name": "pycoingecko",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Christoforou Manolis",
"author_email": "emchristoforou@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/06/13/2678a9ee00171855290a53b2a661e034f710cf063394d685bb74349a3e0b/pycoingecko-3.2.0.tar.gz",
"platform": null,
"description": "# CoinGecko API wrapper\n[![PyPi Version](https://img.shields.io/pypi/v/pycoingecko.svg)](https://pypi.python.org/pypi/pycoingecko/)\n![GitHub](https://img.shields.io/github/license/man-c/pycoingecko)\n\nPython3 wrapper around the [CoinGecko](https://www.coingecko.com/) API (V3) \ud83e\udd8e<br> Supports both Public and Pro API:\n * [Public API v3.0.1](https://docs.coingecko.com/v3.0.1/reference/introduction)\n * [Pro API v3.1.1](https://docs.coingecko.com/v3.1.1/reference/introduction)\n\n### Installation\nPyPI\n```bash\npip install -U pycoingecko\n```\nor from source\n```bash\ngit clone https://github.com/man-c/pycoingecko.git\ncd pycoingecko\npython3 setup.py install\n```\n\n### Usage\n\nFor free **Public API**:\n\n * without any demo api key (x-cg-demo-api-key):\n ```python\n from pycoingecko import CoinGeckoAPI\n cg = CoinGeckoAPI()\n ```\n * \ud83d\udd11 with a <ins>demo api key</ins>:\n ```python\n from pycoingecko import CoinGeckoAPI\n cg = CoinGeckoAPI(demo_api_key='YOUR_DEMO_API_KEY')\n ```\n\nFor **Pro API**:\n * \ud83d\udd11 with a <ins>pro api key</ins>:\n ```python\n from pycoingecko import CoinGeckoAPI\n cg = CoinGeckoAPI(api_key='YOUR_PRO_API_KEY')\n ```\n\n### Examples\nThe required parameters for each endpoint are defined as required (mandatory) parameters for the corresponding functions.\\\n**Any optional parameters** can be passed using same names, as defined in CoinGecko API doc (https://www.coingecko.com/en/api/documentation).\n\nFor any parameter:\n- ***Lists** are supported as input for multiple-valued comma-separated parameters\\\n (e.g. see /simple/price usage examples).*\n- ***Booleans** are supported as input for boolean type parameters; they can be `str` ('true', 'false'') or `bool` (`True`, `False`)\\\n (e.g. see /simple/price usage examples).*\n\nUsage examples:\n```python\n# /simple/price endpoint with the required parameters\n>>> cg.get_price(ids='bitcoin', vs_currencies='usd')\n{'bitcoin': {'usd': 3462.04}}\n\n>>> cg.get_price(ids='bitcoin,litecoin,ethereum', vs_currencies='usd')\n# OR (lists can be used for multiple-valued arguments)\n>>> cg.get_price(ids=['bitcoin', 'litecoin', 'ethereum'], vs_currencies='usd')\n{'bitcoin': {'usd': 3461.27}, 'ethereum': {'usd': 106.92}, 'litecoin': {'usd': 32.72}}\n\n>>> cg.get_price(ids='bitcoin,litecoin,ethereum', vs_currencies='usd,eur')\n# OR (lists can be used for multiple-valued arguments)\n>>> cg.get_price(ids=['bitcoin', 'litecoin', 'ethereum'], vs_currencies=['usd', 'eur'])\n{'bitcoin': {'usd': 3459.39, 'eur': 3019.33}, 'ethereum': {'usd': 106.91, 'eur': 93.31}, 'litecoin': {'usd': 32.72, 'eur': 28.56}}\n\n# optional parameters can be passed as defined in the API doc (https://www.coingecko.com/api/docs/v3)\n>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap='true', include_24hr_vol='true', include_24hr_change='true', include_last_updated_at='true')\n{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}\n# OR (also booleans can be used for boolean type arguments)\n>>> cg.get_price(ids='bitcoin', vs_currencies='usd', include_market_cap=True, include_24hr_vol=True, include_24hr_change=True, include_last_updated_at=True)\n{'bitcoin': {'usd': 3458.74, 'usd_market_cap': 60574330199.29028, 'usd_24h_vol': 4182664683.6247883, 'usd_24h_change': 1.2295378479069035, 'last_updated_at': 1549071865}}\n```\n\n### API documentation\nhttps://www.coingecko.com/en/api/documentation\n\n### \ud83d\udce1 Endpoints included\n> :warning: **Endpoints documentation**: To make sure that you are using properly each endpoint you should check the [API documentation](https://www.coingecko.com/en/api/documentation). Return behaviour and parameters of the endpoints, such as *pagination*, might have changed. <br> Any **optional parameters** defined in CoinGecko API doc can be passed as function parameters using same parameters names with the API *(see Examples above)*.\n<details><summary>ping</summary>\n<p>\n\n* **/ping** \n \n _Check API server status_\n ```python\n cg.ping()\n ```\n</details>\n\n<details><summary>key</summary>\n<p>\n\n* [Pro API] \ud83d\udcbc **/key** \n \n _Monitor your account's API usage, including rate limits, monthly total credits, remaining credits, and more_\n ```python\n cg.key()\n ```\n</details>\n\n<details><summary>simple</summary>\n<p>\n\n* **/simple/price** \n \n _Get the current price of any cryptocurrencies in any other supported currencies that you need_\n ```python\n cg.get_price()\n ```\n* **/simple/token_price/{id}** \n \n _Get current price of tokens (using contract addresses) for a given platform in any other currency that you need_\n ```python\n cg.get_token_price()\n ```\n* **/simple/supported_vs_currencies** \n \n _Get list of supported_vs_currencies_\n ```python\n cg.get_supported_vs_currencies()\n ```\n</details>\n\n<details><summary>coins</summary>\n<p>\n\n* **/coins/list** \n \n _List all supported coins id, name and symbol (no pagination required)_\n ```python\n cg.get_coins_list()\n ```\n\n* [Pro API] \ud83d\udcbc **/coins/top_gainers_losers** \n \n _Query the top 30 coins with largest price gain and loss by a specific time duration_\n ```python\n cg.get_coin_top_gainers_losers()\n ```\n\n* [Pro API] \ud83d\udcbc **/coins/list/new** \n \n _Query the latest 200 coins that recently listed on CoinGecko_\n ```python\n cg.get_coins_list_new()\n ```\n\n* **/coins/markets** \n \n _List all supported coins price, market cap, volume, and market related data_\n ```python \n cg.get_coins_markets()\n ```\n* **/coins/{id}** \n \n _Get current data (name, price, market, ... including exchange tickers) for a coin_\n ```python \n cg.get_coin_by_id()\n ```\n* **/coins/{id}/tickers** \n \n _Get coin tickers (paginated to 100 items)_\n ```python \n cg.get_coin_ticker_by_id()\n ```\n* **/coins/{id}/history** \n \n _Get historical data (name, price, market, stats) at a given date for a coin_\n ```python \n cg.get_coin_history_by_id()\n ```\n* **/coins/{id}/market_chart** \n \n _Get historical market data include price, market cap, and 24h volume (granularity auto)_\n ```python \n cg.get_coin_market_chart_by_id()\n ```\n* **/coins/{id}/market_chart/range** \n \n _Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto)_\n ```python \n cg.get_coin_market_chart_range_by_id()\n ```\n\n[//]: # (* **/coins/{id}/status_updates** (Get status updates for a given coin (beta)))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_coin_status_updates_by_id())\n\n[//]: # ( ```)\n* **/coins/{id}/ohlc** \n \n _Get the OHLC chart (Open, High, Low, Close) of a coin based on particular coin id_\n ```python\n cg.get_coin_ohlc_by_id()\n ```\n\n* [Pro API] \ud83d\udcbc **/coins/{id}/ohlc/range** \n \n _Get the OHLC chart (Open, High, Low, Close) of a coin within a range of timestamp based on particular coin id_\n ```python\n cg.get_coin_ohlc_by_id_range()\n ```\n\n* [Pro API] \ud83d\udc51 **/coins/{id}/circulating_supply_chart** \n \n _Query historical circulating supply of a coin by number of days away from now based on provided coin id_\n ```python\n cg.get_coin_circulating_supply_chart()\n ```\n\n* [Pro API] \ud83d\udc51 **/coins/{id}/circulating_supply_chart/range** \n \n _Query historical circulating supply of a coin, within a range of timestamp based on the provided coin id_\n ```python\n cg.get_coin_circulating_supply_chart_range()\n ```\n\n* [Pro API] \ud83d\udc51 **/coins/{id}/total_supply_chart** \n \n _Query historical total supply of a coin by number of days away from now based on provided coin id_\n ```python\n cg.get_coin_total_supply_chart()\n ```\n\n* [Pro API] \ud83d\udc51 **/coins/{id}/total_supply_chart/range** \n \n _Query historical total supply of a coin, within a range of timestamp based on the provided coin id_\n ```python\n cg.get_coin_total_supply_chart_range()\n ```\n\n</details>\n\n\n<details><summary>contract</summary>\n<p>\n\n* **/coins/{id}/contract/{contract_address}** \n \n _Get coin info from contract address_\n ```python\n cg.get_coin_info_from_contract_address_by_id()\n ```\n* **/coins/{id}/contract/{contract_address}/market_chart/** \n \n _Get historical market data include price, market cap, and 24h volume (granularity auto) from a contract address_\n ```python\n cg.get_coin_market_chart_from_contract_address_by_id()\n ```\n* **/coins/{id}/contract/{contract_address}/market_chart/range** \n \n _Get historical market data include price, market cap, and 24h volume within a range of timestamp (granularity auto) from a contract address_\n ```python\n cg.get_coin_market_chart_range_from_contract_address_by_id()\n ```\n</details>\n\n<details><summary>asset_platforms</summary>\n<p>\n\n* **/asset_platforms** \n \n _List all asset platforms (Blockchain networks)_\n ```python\n cg.get_asset_platforms()\n ```\n\n* [Pro API] \ud83d\udc51 **/token_lists/{asset_platform_id}/all.json** \n \n _Get full list of tokens of a blockchain network (asset platform) that is supported by Ethereum token list standard_\n ```python\n cg.get_asset_platform_by_id()\n ```\n\n</details>\n\n<details><summary>categories</summary>\n<p>\n\n* **/coins/categories/list** \n \n _List all categories_\n ```python\n cg.get_coins_categories_list()\n ```\n* **coins/categories** \n \n _List all categories with market data_\n ```python\n cg.get_coins_categories()\n ```\n</details>\n\n<details><summary>exchanges</summary>\n<p>\n\n* **/exchanges** \n \n _List all exchanges_\n ```python\n cg.get_exchanges_list()\n ```\n* **/exchanges/list** \n \n _List all supported markets id and name (no pagination required)_\n ```python\n cg.get_exchanges_id_name_list()\n ```\n* **/exchanges/{id}** \n \n _Get exchange volume in BTC and top 100 tickers only_\n ```python\n cg.get_exchanges_by_id()\n ```\n* **/exchanges/{id}/tickers** \n \n _Get exchange tickers (paginated, 100 tickers per page)_\n ```python\n cg.get_exchanges_tickers_by_id()\n ```\n\n[//]: # (* **/exchanges/{id}/status_updates** (Get status updates for a given exchange (beta)))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_exchanges_status_updates_by_id())\n\n[//]: # ( ```)\n* **/exchanges/{id}/volume_chart** \n \n _Get volume_chart data for a given exchange_\n ```python\n cg.get_exchanges_volume_chart_by_id()\n ```\n\n* [Pro API] \ud83d\udcbc **/exchanges/{id}/volume_chart/range** \n \n _Query the historical volume chart data in BTC by specifying date range in UNIX based on exchange\u2019s id_\n ```python\n cg.get_exchanges_volume_chart_by_id_within_time_range()\n ``` \n\n</details>\n\n[//]: # (<details><summary>finance</summary>)\n\n[//]: # (<p>)\n\n[//]: # ()\n[//]: # (* **/finance_platforms** (List all finance platforms))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_finance_platforms())\n\n[//]: # ( ```)\n\n[//]: # (* **/finance_products** (List all finance products))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_finance_products())\n\n[//]: # ( ```)\n\n[//]: # (</details>)\n\n<details><summary>indexes</summary>\n<p>\n\n* **/indexes** \n \n _List all market indexes_\n```python\ncg.get_indexes()\n```\n* **/indexes/{market_id}/{id}** \n \n _Get market index by market id and index id_\n```python\ncg.get_indexes_by_market_id_and_index_id()\n```\n* **/indexes/list** \n \n _List market indexes id and name_\n```python\ncg.get_indexes_list()\n```\n</details>\n\n<details><summary>derivatives</summary>\n<p>\n\n* **/derivatives** \n \n _List all derivative tickers_\n ```python\n cg.get_derivatives()\n ```\n* **/derivatives/exchanges** \n \n _List all derivative exchanges_\n ```python\n cg.get_derivatives_exchanges()\n ```\n* **/derivatives/exchanges/{id}** \n \n _Show derivative exchange data_\n ```python\n cg.get_derivatives_exchanges_by_id()\n ```\n* **/derivatives/exchanges/list** \n \n _List all derivative exchanges name and identifier_\n ```python\n cg.get_derivatives_exchanges_list()\n ```\n</details>\n\n<details><summary>nfts (beta)</summary>\n<p>\n\n* **/nfts/list** \n \n _List all supported NFT ids, paginated by 100 items per page, paginated to 100 items_\n ```python\n cg.get_nfts_list()\n ```\n* **/nfts/{id}** \n \n _Get current data (name, price_floor, volume_24h ...) for an NFT collection. native_currency (string) is only a representative of the currency_\n ```python\n cg.get_nfts_by_id()\n ```\n* **/nfts/{asset_platform_id}/contract/{contract_address}** \n \n _Get current data (name, price_floor, volume_24h ...) for an NFT collection. native_currency (string) is only a representative of the currency_\n ```python\n cg.get_nfts_collection_by_asset_platform_id_and_contract_address()\n ```\n\n* [Pro API] \ud83d\udcbc **/nfts/markets** \n \n _Query all the supported NFT collections with floor price, market cap, volume and market related data on CoinGecko_\n ```python\n cg.get_nfts_markets()\n ```\n\n* [Pro API] \ud83d\udcbc **/nfts/{id}/market_chart** \n \n _Query historical market data of a NFT collection, including floor price, market cap, and 24h volume, by number of days away from now_\n ```python\n cg.get_nfts_market_chart_by_id()\n ```\n\n* [Pro API] \ud83d\udcbc **/nfts/{asset_platform_id}/contract/{contract_address}/market_chart** \n \n _Query historical market data of a NFT collection, including floor price, market cap, and 24h volume, by number of days away from now based on the provided contract address_\n ```python\n cg.get_ntfs_market_chart_by_asset_platform_id_and_contract_address()\n ```\n\n* [Pro API] \ud83d\udcbc **/nfts/{id}/tickers** \n \n _Query the latest floor price and 24h volume of a NFT collection, on each NFT marketplace, e.g. OpenSea and LooksRare_\n ```python\n cg.get_nfts_tickers_by_id()\n ```\n\n</details>\n\n[//]: # (<details><summary>status_updates</summary>)\n\n[//]: # (<p>)\n\n[//]: # ()\n[//]: # (* **/status_updates** (List all status_updates with data (description, category, created_at, user, user_title and pin)))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_status_updates())\n\n[//]: # ( ```)\n\n[//]: # (</details>)\n\n[//]: # (<details><summary>events</summary>)\n\n[//]: # (<p>)\n\n[//]: # ()\n[//]: # (* **/events** (Get events, paginated by 100))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_events())\n\n[//]: # ( ```)\n\n[//]: # (* **/events/countries** (Get list of event countries))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_events_countries())\n\n[//]: # ( ```)\n\n[//]: # (* **/events/types** (Get list of events types))\n\n[//]: # ( ```python)\n\n[//]: # ( cg.get_events_types())\n\n[//]: # ( ```)\n\n[//]: # (</details>)\n\n<details><summary>exchange_rates</summary>\n<p>\n\n* **/exchange_rates** \n \n _Get BTC-to-Currency exchange rates_\n ```python\n cg.get_exchange_rates()\n ```\n</details>\n\n<details><summary>search</summary>\n<p>\n\n* **/search** \n \n _Search for coins, categories and markets on CoinGecko_\n ```python\n cg.search()\n ```\n</details>\n\n<details><summary>trending</summary>\n<p>\n\n* **/search/trending** \n \n _Get trending search coins (Top-7) on CoinGecko in the last 24 hours_\n ```python\n cg.get_search_trending()\n ```\n</details>\n\n<details><summary>global</summary>\n<p>\n\n* **/global** \n \n _Get cryptocurrency global data_\n ```python\n cg.get_global()\n ```\n* **/global/decentralized_finance_defi** \n \n _Get cryptocurrency global decentralized finance(defi) data_\n ```python\n cg.get_global_decentralized_finance_defi()\n ```\n\n* [Pro API] \ud83d\udcbc **/global/market_cap_chart**\n\n _Query historical global market cap and volume data by number of days away from now)_\n ```python\n cg.get_global_market_cap_chart()\n ```\n\n</details>\n\n<details><summary>companies (beta)</summary>\n<p>\n\n* **/companies/public_treasury/{coin_id}** \n \n _Query public companies\u2019 bitcoin or ethereum holdings_\n ```python\n cg.get_companies_public_treasury_by_coin_id()\n ```\n</details>\n\n### Test\n\n#### Installation\nInstall required packages for testing using:\n```bash\npip install pytest responses\n```\n\n#### Usage\n\nRun unit tests with:\n\n```\n# after installing pytest and responses using pip3\npytest tests\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python wrapper around the CoinGecko API",
"version": "3.2.0",
"project_urls": {
"Homepage": "https://github.com/man-c/pycoingecko"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7f94fd71f6d25daa9d53da60c7bb3adb5a4f6b92d9ec831c3f3ac1309d430db1",
"md5": "a559960459348c4fb3f1e855f361db1c",
"sha256": "b4fec16e9420b3e2f1ae38ea95710b631c9809cf1bffbf0021cc6608e357925b"
},
"downloads": -1,
"filename": "pycoingecko-3.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a559960459348c4fb3f1e855f361db1c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10841,
"upload_time": "2024-11-13T00:30:06",
"upload_time_iso_8601": "2024-11-13T00:30:06.511960Z",
"url": "https://files.pythonhosted.org/packages/7f/94/fd71f6d25daa9d53da60c7bb3adb5a4f6b92d9ec831c3f3ac1309d430db1/pycoingecko-3.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "06132678a9ee00171855290a53b2a661e034f710cf063394d685bb74349a3e0b",
"md5": "f3e9de3f8774839e5a9bcd6badd5bfd8",
"sha256": "c48935d6e608efd9a798cbc4be30f1b43176cb680503dfef8f9352e038fc7605"
},
"downloads": -1,
"filename": "pycoingecko-3.2.0.tar.gz",
"has_sig": false,
"md5_digest": "f3e9de3f8774839e5a9bcd6badd5bfd8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18002,
"upload_time": "2024-11-13T00:30:08",
"upload_time_iso_8601": "2024-11-13T00:30:08.201151Z",
"url": "https://files.pythonhosted.org/packages/06/13/2678a9ee00171855290a53b2a661e034f710cf063394d685bb74349a3e0b/pycoingecko-3.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-13 00:30:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "man-c",
"github_project": "pycoingecko",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pycoingecko"
}