Skip to main content

CoinGeckoAPI

The CoinGeckoAPI class provides a simple interface for accessing cryptocurrency prices from the CoinGecko API.

Initialization

To create a new instance of the CoinGeckoAPI class, you can optionally specify the base_url parameter. If not specified, the default base URL is https://api.coingecko.com/api/v3/.

api = CoinGeckoAPI(base_url='https://api.coingecko.com/api/v3/)

Methods

get_price_current(coin_id) This method retrieves the current price of a cryptocurrency based on its coin_id. get_volume_current and get_marketcap_current are similar and accepts the same Parameters

coin_id (str): The ID of the cryptocurrency, as defined by CoinGecko.
Returns The current price of the cryptocurrency in USD (float).

get_coins() This method retrieves list of coins on coingecko on current date

This method do not need any Parameters

all_price_data_daily(self,coin_id,days='max'

This method retrieves price data for a particular coin based on its coin_id and days. days is max by default and both the parameters are str. all_volume_data_daily and all_marketcap_data_daily does the same for volume and marketcap respectively.

coin_id (str): The ID of the cryptocurrency, as defined by CoinGecko.
days (str): Number of days for which you want to retrieve the data.
Returns a list of all price.

Metadata

Release files for coingecko-module 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coingecko-module 0.2.0
File Size Uploaded
coingecko_module-0.2.0.tar.gz 1.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coingecko-module 0.2.0
File Interpreter ABI Platform
coingecko_module-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.8 kB

Release files / coingecko_module-0.2.0.tar.gz

Download URL coingecko_module-0.2.0.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9664aebaa48fc78cff6de1fa2c7019be1e999b97c08f901f6bbf2fd8e4f68961
BLAKE2b-256 checksum
How to use checksums
6e969c1e45c963247a64b4abd5f097912a90467ab9896f41675db1c360676da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.8

Release files / coingecko_module-0.2.0-py3-none-any.whl

Download URL coingecko_module-0.2.0-py3-none-any.whl
Size 1.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4f405ab325f7f6efdc5cd191c32802593781a3f8d0a1ac593eb856badec9d44
BLAKE2b-256 checksum
How to use checksums
a218cba12b292d04a2f47d9f3d28db05cd74efd9810d3bd556085c64b2972681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page