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 request to api.blockscout.com/{chain_id}/json-rpc with JSON-RPC 2.0 format. An API keys is required including 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

πŸ”§ 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