Skip to main content

Blockscout ETH RPC Methods Reference

Complete reference for all 16 Ethereum JSON-RPC methods supported by Blockscout.

📋 Quick Reference

PRO API Methods use POST requests to api.blockscout.com/{chain_id}/json-rpc with JSON-RPC 2.0 format. An API key is required, including on the free tier.

Per instance methods use POST requests to {instance_url}/api/eth-rpc with JSON-RPC 2.0 format. An API key is not required but will increase RPS for your calls.
Try these methods in the ETH RPC Endpoint Testing section

PRO API usage

Examples:
  • Ethereum: https://api.blockscout.com/1/json-rpc
  • Optimism: https://api.blockscout.com/10/json-rpc

Base URL Pattern (per instance)

Examples:
  • Ethereum: https://eth.blockscout.com/api/eth-rpc
  • Optimism: https://optimism.blockscout.com/api/eth-rpc

🔢 Methods Overview

Read Operations (State Queries)

Transaction Operations

Block Operations

Call Operations

Log Operations


📚 Detailed Method Specifications

1. eth_blockNumber

Purpose: Get the latest block number in the chain. Request:
Response:

2. eth_getBalance

Purpose: Get the balance of an account at a given address. Parameters:
  • address (string): 20-byte address to check
  • block (string): Block number in hex, or “latest”, “earliest”, “pending”
Request:
Response:
Note: Result is in wei (hexadecimal).

3. eth_getLogs

Purpose: Get event logs matching a filter. Parameters:
  • filter (object): Filter criteria
    • fromBlock (string): Starting block
    • toBlock (string): Ending block
    • address (string|array): Contract address(es)
    • topics (array): Topic filters
Request:
Limitations: Maximum 1000 logs per request. Use pagination for more.

4. eth_gasPrice

Purpose: Get current gas price. Request:
Response:

5. eth_getTransactionByHash

Purpose: Get transaction details by hash. Parameters:
  • hash (string): 32-byte transaction hash
Request:
Response:

6. eth_getTransactionReceipt

Purpose: Get transaction receipt including logs and status. Parameters:
  • hash (string): 32-byte transaction hash
Request:
Response:
Status values:
  • 0x1 = Success
  • 0x0 = Failure

7. eth_chainId

Purpose: Get the chain ID for signing replay-protected transactions. Request:
Response:
Common Chain IDs:
  • 0x1 = Ethereum Mainnet
  • 0x2105 = Base
  • 0xa = Optimism
  • 0x64 = Gnosis Chain

8. eth_maxPriorityFeePerGas

Purpose: Get max priority fee per gas for EIP-1559 transactions. Request:
Response:

9. eth_getTransactionCount

Purpose: Get the nonce (transaction count) for an address. Parameters:
  • address (string): 20-byte address
  • block (string): Block number in hex, or “latest”, “earliest”, “pending”
Request:
Response:

10. eth_getCode

Purpose: Get the bytecode at a given address (smart contract code). Parameters:
  • address (string): 20-byte address
  • block (string): Block number in hex, or “latest”, “earliest”, “pending”
Request:
Response:
Note: Returns “0x” for EOAs (non-contract addresses).

11. eth_getStorageAt

Purpose: Get value from a storage position at a given address. Parameters:
  • address (string): 20-byte address of the storage
  • position (string): Position in hex
  • block (string): Block number in hex, or “latest”, “earliest”, “pending”
Request:
Response:

12. eth_estimateGas

Purpose: Estimate gas required to execute a transaction. Parameters:
  • transaction (object): Transaction call object
    • from (string, optional): Sender address
    • to (string): Recipient address
    • value (string, optional): Value in hex
    • data (string, optional): Call data
    • gas (string, optional): Gas limit in hex
    • gasPrice (string, optional): Gas price in hex
  • block (string, optional): Block number or “latest”
Request:
Response:

13. eth_getBlockByNumber

Purpose: Get block information by block number. Parameters:
  • block (string): Block number in hex, or “latest”, “earliest”, “pending”
  • fullTx (boolean): If true, returns full transaction objects; if false, only hashes
Request:
Response:

14. eth_getBlockByHash

Purpose: Get block information by block hash. Parameters:
  • hash (string): 32-byte block hash
  • fullTx (boolean): If true, returns full transaction objects; if false, only hashes
Request:

15. eth_sendRawTransaction

Purpose: Submit a pre-signed transaction for broadcast. Parameters:
  • data (string): Signed transaction data in hex
Request:
Response:
Note: Result is the transaction hash.

16. eth_call

Purpose: Execute a contract call immediately without creating a transaction. Parameters:
  • transaction (object): Transaction call object
    • to (string): Contract address
    • from (string, optional): Sender address
    • data (string): Encoded function call
    • gas (string, optional): Gas limit
    • gasPrice (string, optional): Gas price
    • value (string, optional): Value to send
  • block (string, optional): Block number or “latest”
Request:
Response:
Common Use Cases:
  • Reading contract state
  • Simulating transactions
  • Calling view/pure functions
  • Checking balances of ERC-20 tokens

🧪 Recipes

Read a no-argument view function on a verified contract

Use eth_call with data set to the first 4 bytes of keccak256("<functionSignature>"). For a function like rewardRate(), the selector is 0x7b0a47ee.
The result is the ABI-encoded return value, right-padded to 32 bytes. For a uint256 return, parse the full hex string as an integer. To find the function selector for any signature, hash it with keccak256 (any Web3 library exposes this, for example ethers.id("rewardRate()").slice(0, 10)). For functions with arguments, ABI-encode the parameters and append them to the selector (cast calldata "balanceOf(address)" 0x… from Foundry produces the full data payload).

Read the implementation address of an EIP-1967 proxy

EIP-1967 proxies keep the implementation address at storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bb3. Fetch it with eth_getStorageAt:
The result is 32 bytes; the implementation address is the last 20 bytes (strip the leading zero padding). If the proxy is already verified in Blockscout, the getsourcecode contract RPC action returns ImplementationAddress and IsProxy directly, so you can skip the storage read.

🔧 Usage Tips

Batch Requests

You can send multiple requests in a single HTTP call:

Error Handling

JSON-RPC errors follow this format:
Common error codes:
  • -32700 = Parse error
  • -32600 = Invalid request
  • -32601 = Method not found
  • -32602 = Invalid params
  • -32603 = Internal error