Coin Metrics Python API Client
The Coin Metrics Python API Client is the official Python wrapper for the Coin Metrics API, allowing you to access Coin Metrics data using Python. In just a few lines of code, anyone can access clean cryptocurrency data in a familiar form, such as apandas DataFrame.
This tool offers the following convenient features over simply using requests to query the Coin Metrics API:
- Automatic Pagination — the Coin Metrics API limits most endpoints to no more than 10,000 entries; the client handles pagination transparently.
- DataFrames — access Coin Metrics data using
pandasorpolarsDataFrames. - Data Exports — export API outputs to CSV and JSON files.
- Typing — DataFrame columns are automatically converted to the appropriate data types.
- Parallelization — submit many requests concurrently to extract data quickly.
Installation
Install the client from PyPI:Installing Behind a Private Network
Related to SSL certificate verification, you may have trouble installing and updating PyPI packages on a corporate network. Choose the option that fits your environment. Using package managers Full instructions for setting up your environment to useconda, pip, yarn, npm, etc. can be found here. A workaround to disable SSL verification when installing a trusted Python package is:
- Download the files for the Coin Metrics API Client from PyPI.
- Install it locally.
Initialization
To initialize the client you should use your API key, and theCoinMetricsClient class:
verbose=True will print each call and basic performance information to the console:
DataCollection objects, DataFrames, and file exports work.
