CoinGecko API icon

CoinGecko API

Accède aux données de cryptomonnaies via l'API CoinGecko - Prix, marchés, historiques

Get Token Price by Contract

AI-generated

Overview

This node operation retrieves the price of a cryptocurrency token by its contract address on a specified asset platform using the CoinGecko API. It is useful for scenarios where users need to get the current price of tokens that are identified by their blockchain contract addresses, such as Ethereum tokens. For example, a user can input the asset platform ID (e.g., 'ethereum'), the token's contract address, and the desired currency to get the token's price in that currency.

Use Case Examples

  1. Get the price of an Ethereum-based token by providing the Ethereum platform ID, the token's contract address, and the price currency (e.g., USD).
  2. Retrieve token prices for tokens on other supported asset platforms by specifying the appropriate platform ID and contract address.

Properties

Name Meaning
Asset Platform ID The ID of the asset platform where the token contract is deployed (e.g., 'ethereum'). This identifies the blockchain platform for the token.
Contract Address The contract address of the token on the specified asset platform. This uniquely identifies the token.
VS Currency The reference currency in which the token price is requested (e.g., USD, EUR, BTC).

Output

JSON

  • json - The JSON response from the CoinGecko API containing the token price data by contract address in the specified currency.

Dependencies

  • CoinGecko public API
  • No authentication required

Troubleshooting

  • If the contract address or asset platform ID is incorrect or unsupported, the API may return an error or empty data. Verify the inputs.
  • Network issues or API downtime can cause request failures. Retry or check CoinGecko API status.
  • Ensure the VS Currency is supported by CoinGecko; otherwise, the price data may not be returned.

Links

Discussion