For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_getBlockByNumber - ARC

Example code for the eth_getBlockByNumber JSON-RPC method. Complete guide on how to use eth_getBlockByNumber JSON-RPC in GetBlock Web3 documentation.

This method returns information about a block by block number. Pass "latest", "earliest", "pending", "safe", or "finalized" as a block tag, or a hex-encoded block number. The second argument controls whether the response includes full transaction objects or only transaction hashes. On Arc, "safe" and "finalized" reflect Malachite's deterministic finality and are typically only a few blocks behind "latest".

Parameters

Parameter
Type
Required
Description

blockParameter

string

Yes

Block number in hex, or "latest", "earliest", "pending", "safe", "finalized"

fullTransactions

boolean

Yes

If true, returns full transaction objects; if false, only hashes

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": [
        "latest",
        false
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.number

string

Block number (hex)

result.hash

string

Block hash (32 bytes hex)

result.parentHash

string

Hash of the parent block

result.timestamp

string

Unix timestamp at which the block was sealed (hex)

result.gasLimit

string

Maximum gas allowed in this block (hex)

result.gasUsed

string

Total gas used by all transactions in this block (hex)

result.transactions

array

Array of transaction hashes, or full transaction objects if fullTransactions=true

result.stateRoot

string

Root of the final state trie of the block

result.receiptsRoot

string

Root of the receipts trie of the block

Use Cases

  • Block-by-block indexing of Arc transactions

  • Building explorers and payments analytics dashboards

  • Computing per-block statistics (gas usage, tx count, USDC fees)

  • Reading recently finalized blocks for trust-minimized applications

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32601

Method not found

The method is not supported by this node

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Was this helpful?