Blockchain Explorer
Actions22
- Account Actions
- Block Actions
- Contract Actions
- Gas Actions
- Stat Actions
- Token Actions
- Transaction Actions
Overview
This node interacts with multiple blockchain networks through their explorer APIs, which are compatible with Etherscan-like services. It allows users to query various blockchain data such as account balances, transactions, blocks, contracts, gas prices, token statistics, and more.
Specifically, the Stat > Get Token Price operation fetches the latest price of the native token on a selected blockchain network. This is useful for applications that need up-to-date token valuation, such as portfolio trackers, DeFi dashboards, or alerting systems.
Practical examples:
- Fetching the current Ethereum price on the Ethereum mainnet.
- Retrieving the native token price on Polygon or Binance Smart Chain for cross-chain analytics.
- Integrating live token price data into financial reports or trading bots.
Properties
| Name | Meaning |
|---|---|
| Network | The blockchain network to query. Options include: Arbitrum, Avalanche, Binance Smart Chain, Celo, Cronos, Ethereum, Fantom, Moonbeam, Optimism, Polygon |
Output
The output JSON contains the following fields:
network: The blockchain network queried (e.g., "ethereum").resource: The resource type, here always"stats".operation: The operation performed, here"getTokenPrice".- Additional fields returned by the API, typically including:
- Latest native token price information (e.g., in USD).
- Possibly other metadata related to the token price depending on the API response.
The exact structure depends on the external blockchain explorer API's response but generally includes status, message, and result fields with pricing data.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for the blockchain explorer service.
- Uses the Axios HTTP client to make requests to the blockchain explorer API.
- The base URL for the API is either custom-configured or derived from the selected network and environment.
- No additional environment variables are required beyond the API key credential.
Troubleshooting
Common issues:
- Invalid or missing API key credential will cause authentication errors.
- Selecting an unsupported network or incorrect network name may lead to failed API calls.
- API rate limits might be hit if too many requests are made in a short time.
- Network connectivity issues can prevent successful API calls.
Error messages:
API Error: <message>indicates the blockchain explorer API returned an error. Check the message for details, such as invalid parameters or quota exceeded.- Node operation errors may also occur if required parameters are missing or malformed.
Resolutions:
- Ensure the API key credential is correctly configured and valid.
- Verify the network selection matches supported options.
- Respect API rate limits; consider adding delays or retries.
- Confirm all required input parameters are provided and correctly formatted.
Links and References
- Etherscan API Documentation
- n8n Documentation on Creating Nodes
- Blockchain explorer websites for respective networks (e.g., https://etherscan.io, https://polygonscan.com)