get_multiple_tokens_data
Retrieve token data for multiple contracts on specified blockchain networks to support trading decisions and portfolio analysis.
Instructions
Get data for multiple tokens by their contract addresses
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"network": "<network>",
"addresses": "<addresses>"
},
"name": "get_multiple_tokens_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network ID (e.g., 'eth', 'bsc', 'polygon_pos') | |
| addresses | Yes | Token contract addresses, comma-separated for multiple tokens | |
| include | No | Attributes to include: 'top_pools' (optional) |
Implementation Reference
- Core helper: Constructs CoinGecko API URL for /networks/{network}/tokens/multi/{addresses} and performs authenticated fetch request.
async getMultipleTokensData(network, addresses, options = {}) { try { const queryParams = new URLSearchParams(); if (options.include) queryParams.append('include', options.include); const url = `${this.baseUrl}/networks/${network}/tokens/multi/${addresses}${queryParams.toString() ? '?' + queryParams.toString() : ''}`; const response = await fetch(url, { headers: { 'x-cg-demo-api-key': this.apiKey } }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } return await response.json(); } catch (error) { throw new Error(`Failed to get multiple tokens data: ${error.message}`); } }