Guides

Fetch a block

After you know the tip, fetch a concrete block. Pass false (or equivalent) when you only need headers — full transaction objects cost more bandwidth and credits.

eth_getBlockByNumbergetBlockgetblock

← All guides

Steps

  1. Get a block identifier: height (hex on EVM), slot (Solana), or hash (Bitcoin).
  2. Call the family get-block method with the right verbosity flag.
  3. Remember: full node, not archive — very old historical blocks may be pruned depending on the chain and node config.
  4. For transaction details inside the block, follow the get-transaction guide.

EVM block by number (tx hashes only) (curl)

curl

curl https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockByNumber",
  "params": [
    "latest",
    false
  ]
}'

EVM block by number (tx hashes only) (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-ethereum-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getBlockByNumber',
    params: [
      "latest",
      false
    ],
  }),
});

const data = await response.json();
console.log(data);

Solana getBlock (confirmed) (curl)

curl

curl https://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlock",
  "params": [
    300000000,
    {
      "encoding": "json",
      "transactionDetails": "signatures",
      "rewards": false,
      "maxSupportedTransactionVersion": 0
    }
  ]
}'

Solana getBlock (confirmed) (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'getBlock',
    params: [
      300000000,
      {
        "encoding": "json",
        "transactionDetails": "signatures",
        "rewards": false,
        "maxSupportedTransactionVersion": 0
      }
    ],
  }),
});

const data = await response.json();
console.log(data);

Bitcoin getblock (verbosity 1) (curl)

curl

curl https://holy-burned-sky-bitcoin-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getblock",
  "params": [
    "0000000000000000000123456789abcdef0123456789abcdef0123456789abcd",
    1
  ]
}'

Bitcoin getblock (verbosity 1) (JavaScript)

fetch

const response = await fetch('https://holy-burned-sky-bitcoin-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'getblock',
    params: [
      "0000000000000000000123456789abcdef0123456789abcdef0123456789abcd",
      1
    ],
  }),
});

const data = await response.json();
console.log(data);

Tips

  • On EVM, true as the second arg expands full transactions — heavy; prefer false then eth_getTransactionByHash.
  • Solana getBlock requires a slot that still exists in the node’s retention window.
  • Bitcoin verbosity: 0 = hex, 1 = JSON txids, 2 = JSON full txs.

Related