Skip to main content

Blockscout ETH RPC Methods Reference

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

📋 Quick Reference

Methods use POST requests to /api/eth-rpc with JSON-RPC 2.0 format. API keys are not required but will increase RPS for your calls.
Try these methods in the ETH RPC Endpoint Testing section

Base URL Pattern

https://{instance}.blockscout.com/api/eth-rpc
Examples:
  • https://eth.blockscout.com/api/eth-rpc
  • https://base.blockscout.com/api/eth-rpc
  • https://optimism.blockscout.com/api/eth-rpc

🔢 Methods Overview

Read Operations (State Queries)

MethodDescriptionParameters
eth_blockNumberGet latest block numberNone
eth_getBalanceGet account balanceaddress, block
eth_getTransactionCountGet nonceaddress, block
eth_getCodeGet contract bytecodeaddress, block
eth_getStorageAtGet storage valueaddress, position, block
eth_gasPriceGet current gas priceNone
eth_maxPriorityFeePerGasGet max priority feeNone
eth_chainIdGet chain IDNone

Transaction Operations

MethodDescriptionParameters
eth_getTransactionByHashGet transaction detailshash
eth_getTransactionReceiptGet transaction receipthash
eth_sendRawTransactionSubmit signed transactionsignedData

Block Operations

MethodDescriptionParameters
eth_getBlockByNumberGet block by numberblockNumber, fullTx
eth_getBlockByHashGet block by hashblockHash, fullTx

Call Operations

MethodDescriptionParameters
eth_callExecute contract calltransaction, block
eth_estimateGasEstimate gas costtransaction, block

Log Operations

MethodDescriptionParameters
eth_getLogsGet event logsfilter

📚 Detailed Method Specifications

1. eth_blockNumber

Purpose: Get the latest block number in the chain. Request:
{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x1234567",
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": [
    "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "latest"
  ],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x1d863bf76508104fb",
  "id": 1
}
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:
{
  "jsonrpc": "2.0",
  "method": "eth_getLogs",
  "params": [{
    "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "fromBlock": "0x1234567",
    "toBlock": "latest",
    "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
  }],
  "id": 1
}
Limitations: Maximum 1000 logs per request. Use pagination for more.

4. eth_gasPrice

Purpose: Get current gas price. Request:
{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x4a817c800",
  "id": 1
}

5. eth_getTransactionByHash

Purpose: Get transaction details by hash. Parameters:
  • hash (string): 32-byte transaction hash
Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionByHash",
  "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": {
    "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b",
    "from": "0x...",
    "to": "0x...",
    "value": "0x...",
    "gas": "0x...",
    "gasPrice": "0x...",
    "input": "0x...",
    "nonce": "0x...",
    "blockNumber": "0x...",
    "blockHash": "0x...",
    "transactionIndex": "0x..."
  },
  "id": 1
}

6. eth_getTransactionReceipt

Purpose: Get transaction receipt including logs and status. Parameters:
  • hash (string): 32-byte transaction hash
Request:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": {
    "transactionHash": "0x88df...",
    "transactionIndex": "0x1",
    "blockHash": "0x...",
    "blockNumber": "0x...",
    "from": "0x...",
    "to": "0x...",
    "cumulativeGasUsed": "0x...",
    "gasUsed": "0x5208",
    "contractAddress": null,
    "logs": [],
    "logsBloom": "0x...",
    "status": "0x1",
    "effectiveGasPrice": "0x..."
  },
  "id": 1
}
Status values:
  • 0x1 = Success
  • 0x0 = Failure

7. eth_chainId

Purpose: Get the chain ID for signing replay-protected transactions. Request:
{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x1",
  "id": 1
}
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:
{
  "jsonrpc": "2.0",
  "method": "eth_maxPriorityFeePerGas",
  "params": [],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x59682f00",
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "latest"
  ],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x5",
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_getCode",
  "params": [
    "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
    "latest"
  ],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056",
  "id": 1
}
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:
{
  "jsonrpc": "2.0",
  "method": "eth_getStorageAt",
  "params": [
    "0x295a70b2de5e3953354a6a8344e616ed314d7251",
    "0x0",
    "latest"
  ],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [{
    "from": "0x8D97689C9818892B700e27F316cc3E41e17fBeb9",
    "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
    "value": "0x186a0"
  }, "latest"],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x5208",
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": ["0x1234567", false],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": {
    "number": "0x1234567",
    "hash": "0x...",
    "parentHash": "0x...",
    "timestamp": "0x...",
    "transactions": ["0x...", "0x..."],
    "gasLimit": "0x...",
    "gasUsed": "0x...",
    "miner": "0x...",
    ...
  },
  "id": 1
}

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:
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByHash",
  "params": [
    "0x9b83c12c69edb74f6c8dd5d052765c1adf940e320bd1291696e6fa07829eee71",
    false
  ],
  "id": 1
}

15. eth_sendRawTransaction

Purpose: Submit a pre-signed transaction for broadcast. Parameters:
  • data (string): Signed transaction data in hex
Request:
{
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": ["0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
  "id": 1
}
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:
{
  "jsonrpc": "2.0",
  "method": "eth_call",
  "params": [{
    "to": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"
  }, "latest"],
  "id": 1
}
Response:
{
  "jsonrpc": "2.0",
  "result": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "id": 1
}
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:
[
  {
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  },
  {
    "jsonrpc": "2.0",
    "method": "eth_gasPrice",
    "params": [],
    "id": 2
  }
]

Error Handling

JSON-RPC errors follow this format:
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32602,
    "message": "Invalid params"
  },
  "id": 1
}
Common error codes:
  • -32700 = Parse error
  • -32600 = Invalid request
  • -32601 = Method not found
  • -32602 = Invalid params
  • -32603 = Internal error