CoinPaprika Python SDK
The official Python client library for the CoinPaprika API provides convenient access to cryptocurrency market data.See also: REST API Reference, Coverage Checker, Historical OHLCV
Installation
Install the CoinPaprika Python SDK using pip:Quick Start
Free Plan
For basic usage with the free API plan:Pro Plan
To access Pro features and higher rate limits, initialize the client with your API key.Get your API key at coinpaprika.com/api
Common Use Cases
Getting Market Data
Coin Information
Historical Data
The primary method for fetching historical OHLCV data isohlcv(). Using an API key is required for most historical data access.
Exchange Data
Search and Price Conversion
People and Tags
Error Handling
The client raises specific exceptions for different HTTP error codes. It is best practice to catch these specific exceptions.Available Methods
Global Data
global_market()- Get global market overview.
Coins
coins()- List all coins.coin(coin_id)- Get details for a specific coin.twitter(coin_id)- Get a coin’s Twitter timeline.events(coin_id)- Get a coin’s events.exchanges(coin_id)- Get exchanges for a specific coin.markets(coin_id, **params)- Get market data for a specific coin.candle(coin_id, **params)- Get the latest OHLCV data for a coin.historical(coin_id, **params)- Get historical OHLCV data.today(coin_id)- Get today’s OHLC data.
People
people(person_id)- Get person by ID.
Tags
tags(sort_by)- List tags.tag(tag_id)- Get tag by ID.
Tickers
tickers()- Get tickers for all coins.ticker(coin_id)- Get ticker for a specific coin.historical_ticker(coin_id, **params)- Get historical ticks.
Exchanges
exchange_list()- List all exchanges.exchange(exchange_id, **params)- Get a specific exchange.exchange_markets(exchange_id, **params)- Get exchange markets.
Tools
search(q, **params)- Search for coins, exchanges, etc.price_converter(**params)- Convert between currencies.
Requirements
- Python >= 3.7
requestslibrary
License
This library is available under the Apache License 2.0. See the LICENSE file for more info.FAQs
How do I authenticate with the Python SDK?
How do I authenticate with the Python SDK?
Initialize
Client(api_key=“YOUR_API_KEY”) for Pro features and higher limits. Free usage works with Client() for public endpoints.Where do I find the coin_id (e.g., btc-bitcoin)?
Where do I find the coin_id (e.g., btc-bitcoin)?
Use the Coverage Checker or the REST
/coins endpoint to look up canonical IDs.How do I fetch historical OHLCV?
How do I fetch historical OHLCV?
Use
client.ohlcv(coin_id, start=…, end=…) with an API key. See the OHLCV example above.How should I handle rate limits and errors?
How should I handle rate limits and errors?
Catch SDK exceptions (e.g.,
CoinpaprikaAPITooManyRequestsException) and back off before retrying.