Python wrapper around the CoinGecko API
Slowing down. Last release over 2 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install pycoingeckoCoinGecko API wrapper
Python3 wrapper around the CoinGecko API (V3) 🦎
Supports both Public and Pro API:
Installation
PyPI
pip install -U pycoingecko
or from source
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):
from pycoingecko import CoinGeckoAPI cg = CoinGeckoAPI() - 🔑 with a demo api key:
from pycoingecko import CoinGeckoAPI cg = CoinGeckoAPI(demo_api_key='YOUR_DEMO_API_KEY')
For Pro API:
- 🔑 with a pro api key:
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'') orbool(True,False)
(e.g. see /simple/price usage examples).