Crypto APIs icon

Crypto APIs

Interact with Crypto APIs REST API

Actions113

Overview

This node interacts with the Crypto APIs REST API to retrieve blockchain-related data. Specifically, for the "blocks" resource and the "Get Last Mined Block EVM" operation, it fetches information about the most recently mined block on an Ethereum Virtual Machine (EVM) compatible blockchain network.

Common scenarios where this node is beneficial include:

  • Monitoring the latest block on a specific blockchain network to track new transactions or blocks.
  • Triggering workflows based on the arrival of new blocks.
  • Gathering blockchain state information for analytics or reporting purposes.

For example, a user might configure this node to get the last mined block on the Ethereum mainnet or Binance Smart Chain, then use that data to analyze transaction volume or confirm block confirmations.

Properties

Name Meaning
blockchain The name or identifier of the blockchain network to query (e.g., Ethereum, Binance Smart Chain).
network The specific network within the blockchain (e.g., mainnet, testnet).
context Optional string to correlate or label the request context; can be used for tracking or logging purposes.

Output

The node outputs JSON data representing the details of the last mined block on the specified EVM-compatible blockchain network. This typically includes block attributes such as block number, hash, timestamp, miner address, transaction count, and other relevant metadata provided by the Crypto APIs service.

If the node supports binary data output, it would generally relate to any raw block data or associated files, but in this case, the output is primarily structured JSON describing the block.

Dependencies

  • Requires an active connection to the Crypto APIs REST API.
  • Needs an API key credential configured in n8n to authenticate requests.
  • Relies on the Crypto APIs endpoint definitions loaded from a local JSON specification file (2024-12-12-final.json).
  • Uses internal helper functions to make HTTP requests to the Crypto APIs service.

Troubleshooting

  • Operation Not Found Error: If the specified operation ("Get Last Mined Block EVM") is not found in the API specification, the node will throw an error. Ensure the operation name is correct and supported by the installed version of the node.
  • Missing Required Parameters: The blockchain and network parameters are required. Omitting them will cause errors or invalid API calls.
  • API Authentication Errors: If the API key credential is missing or invalid, requests will fail. Verify that the API key is correctly set up in n8n credentials.
  • Network or Rate Limit Issues: Network connectivity problems or hitting API rate limits may cause request failures. Check network status and API usage quotas.
  • Context Parameter Usage: The optional context parameter does not affect the API call but can be used for logging or tracing. Misuse should not cause errors but ensure it is used consistently if applied.

Links and References

Discussion