eth_getBlockByNumber

AvalancheC1

Returns block information by number. The second parameter controls whether transactions are returned as full objects (true) or just hashes (false).

Endpoint
POST https://api.1st-node.com/v1/avalanche/rpc

Parameters

NameTypeDescription
blockQUANTITY | TAGBlock number or tag.
fullTxBooleantrue for full transaction objects, false for hashes.

Returns

Object — the block header, transactions and metadata, or null if not found.

Request

curl https://api.1st-node.com/v1/avalanche/rpc \
  -H "Authorization: Bearer $ONE_KEY" \
  -H "content-type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockByNumber",
  "params": ["latest", false]
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockByNumber",
  "params": ["latest", false]
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": { "number": "0x12d4e2a", "hash": "0x…", "transactions": ["0x…"] }
}
More blocks methods on Avalanche

Avalanche API

Preguntas frecuentes

Can I fetch old blocks?

Yes — any historic block is available from archive nodes.

Recarga, obtén tu clave y publica.

Autoservicio. Paga en cripto o con tarjeta. Medido por créditos: las primitivas pesadas cuestan más, las simples son baratas.

Obtener clave API