A plugin for Eliza that enables cryptocurrency price checking using the CoinMarketCap API.
- Real-time cryptocurrency price checking
- Support for multiple cryptocurrencies (BTC, ETH, SOL, etc.)
- Currency conversion (USD, EUR, etc.)
- Detailed price and market data
- Natural language processing for price queries
npm install @elizaos/plugin-coinmarketcap
-
Get your API key from CoinMarketCap
-
Set up your environment variables:
COINMARKETCAP_API_KEY=your_api_key
- Register the plugin in your Eliza configuration:
import { CoinMarketCapPlugin } from "@elizaos/plugin-coinmarketcap";
// In your Eliza configuration
plugins: [
new CoinMarketCapPlugin(),
// ... other plugins
];
The plugin responds to natural language queries about cryptocurrency prices. Here are some examples:
"What's the current price of Bitcoin?"
"Show me ETH price in USD"
"Get the price of SOL"
The plugin supports major cryptocurrencies including:
- Bitcoin (BTC)
- Ethereum (ETH)
- Solana (SOL)
- USD Coin (USDC)
- And many more...
Fetches the current price of a cryptocurrency.
// Example response format
{
symbol: "BTC",
price: 50000.00,
currency: "USD",
marketCap: 1000000000000,
volume24h: 50000000000,
percentChange24h: 2.5
}
Variable | Description | Required |
---|---|---|
COINMARKETCAP_API_KEY | Your CoinMarketCap API key | Yes |
interface PriceData {
price: number;
marketCap: number;
volume24h: number;
percentChange24h: number;
}
interface GetPriceContent {
symbol: string;
currency: string;
}
The plugin includes comprehensive error handling for:
- Invalid API keys
- Rate limiting
- Network timeouts
- Invalid cryptocurrency symbols
- Unsupported currencies
CoinMarketCap API has different rate limits based on your subscription plan. Please refer to CoinMarketCap's pricing page for detailed information.
For support, please open an issue in the repository or reach out to the maintainers:
- Discord: 0xspit