Data / RPC

Read a block with transactions

You need a block and every transaction inside it — for indexing, reorg checks or analytics. Standard eth_getBlockByNumber with the full flag returns exactly that. It works unchanged against our RPC; only the base URL and Bearer header differ.

Antes de empezar
  • An API key (sk_live_...) with read access.
  • A block number in hex, or a tag like latest.

1Request the block with full transactions

POST eth_getBlockByNumber with the hex block number and true to include full transaction objects instead of just hashes.

curl https://api.1st-node.com/v1/rpc/eth \
  -H "Authorization: Bearer sk_live_..." \
  -d '{"method":"eth_getBlockByNumber","params":["0x10d4f",true]}'

2Read the block and its transactions

The result carries the header fields plus a transactions array of full objects, so you avoid a second round trip per transaction.

> {
>   "number": "0x10d4f",
>   "hash": "0xf90b...2a71",
>   "timestamp": "0x5c9a...",
>   "transactions": [
>     { "hash": "0x8f2a...c91b", "from": "0x1f3c...", "to": "0x53d2...9a1f", "value": "0x0" }
>   ]
> }

3Read old blocks from archive depth

Any historical block number resolves the same way. Old blocks are served from our archive nodes (C2 at archive depth) with no node to run yourself.

Preguntas frecuentes

How do I get only transaction hashes instead of full objects?

Pass false as the second param to eth_getBlockByNumber. The transactions array then holds hashes, which is smaller and faster to fetch.

Can I read blocks from the earliest history?

Yes. Historical blocks come from our own archive nodes. Standard JSON-RPC works unchanged and you pay per call rather than per server.

Sigue leyendo

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