# CoinGecko Coin Data Tool

#### CoinGecko Coin Data Tool (`coingecko_coin_data_tool`)

Fetches detailed market data (price, volume, market cap, etc.) for one or more specific cryptocurrencies from CoinGecko. Accepts common coin names or tickers.

***

```python
class CoinGeckoCoinDataInput(BaseModel):
    coinname: str # e.g., "bitcoin", "sol", "ethereum,cardano"
```

***

**Key Functionality:**

* Retrieves current market data for specified cryptocurrencies from `api.coingecko.com`.
* Handles common names (e.g., "bitcoin", "solana") and tickers (e.g., "BTC", "SOL") using an internal mapping to CoinGecko IDs.
* Provides price, market cap, rank, 24h volume, 24h price range, and 24h price change.

***

**Sample Usage Queries (How an AI might use it):**

* "Get the CoinGecko data for Bitcoin."
* "What's the current price and market cap of Ethereum and Solana?"
* "Fetch market details for $SOL."
* "Show me the CoinGecko info for Cardano, Polkadot, and Avalanche."
* "Get data for dogecoin."
* "What are the stats for Wrapped Bitcoin (WBTC) from CoinGecko?"
* "Find CoinGecko market data for Bonk."
* "Fetch details for 'shiba inu'."

***

```python
class CoinGeckoCoinDataTool(BaseTool):
    name: ClassVar[str] = "coingecko_coin_data_tool"
    description: ClassVar[str] = "Get detailed market data (price, volume, market cap) for specific cryptocurrencies..."
    args_schema: ClassVar[Type[BaseModel]] = CoinGeckoCoinDataInput
```

***

**Important:**

* This tool operates **asynchronously** (`_arun`) only.
* Relies on the external CoinGecko API; functionality and data accuracy depend on this service.
* Uses an internal list to map common coin names/tickers to CoinGecko IDs; for less common coins, the exact CoinGecko ID might be needed if not in the mapping.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.lumolabs.ai/tools/coingecko-coin-data-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
