For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Ethereum


Ethereum API is available on Web3 API platform.

In order for your Web3 application to interact with the Ethereum blockchain — either by reading blockchain data or sending transactions to the network — it must connect to an Ethereum node.

For this purpose, every Ethereum client implements a JSON-RPC specification, so there are a uniform set of methods that applications can rely on regardless of the specific node or client implementation.

JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in many various message passing environments. It uses JSON (RFC 4627) as data format.

Gossip, State, History

A handful of core JSON-RPC methods query data from the Ethereum network, and fall neatly into three main categories: Gossip, State, and History. Use the links in these sections to jump to each method, or use the table of contents to explore the whole list of methods.

Gossip methods

These methods track the head of the chain. This is how transactions make their way around the network, find their way into blocks, and how clients find out about new blocks.

State methods

Methods that report the current state of all the data stored. The "state" is like one big shared piece of RAM, and includes account balances, contract data, and gas estimations.

  • eth_getBalance — returns the balance of the account specified by address.
  • eth_getStorageAt — returns the value from a storage position at an address specified.
  • eth_getTransactionCount — returns the number of transactions sent from an address.
  • eth_getCode — returns code at an address specified.
  • eth_call — executes a new message call immediately without creating a transaction on the blockchain.
  • eth_estimateGas — generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
  • eth_simulateV1 — simulates multiple blocks and transactions without creating transactions or blocks on the blockchain.

History methods

Fetches historical records of every block back to genesis. This is like one large append-only file, and includes all block headers, block bodies, uncle blocks, and transaction receipts.

Trace and debug methods

Available on archive nodes for Premium and Enterprise plans, and priced the same as standard calls. These methods return internal execution traces for historical transactions and blocks.

  • trace_filter — retrieve traces that match filter criteria.
  • trace_transaction — retrieves the traces created during the execution of a given transaction.
  • trace_replayTransaction — replays a transaction and returns the traces produced by its execution along with the state changes.
  • trace_replayBlockTransactions — replays all the transactions in a given block and returns the traces produced by their execution along with the state changes.
  • trace_block — retrieves a detailed trace of all the transactions in a specific block.
  • debug_traceBlockByHash — traces the execution of all transactions within a block specified by hash.
  • debug_traceBlockByNumber — traces the execution of all transactions within a block specified by number.
  • debug_traceBlock — traces the execution of all transactions within a block.

Trace and debug methods

The trace_* and debug_* families are served on the Ethereum archive node and are available on the Premium and Enterprise plans. They are priced the same as standard calls.

Each API key has a block-range cap for these methods. A request whose block range exceeds the cap returns error -32602 (invalid params); narrow the block range or contact support to raise the cap for your key. See Per-chain & method quirks for the current limits.


Methods

web3, net, eth, Gossip, State, History

History, eth, Trace and debug