---
title: "Get blocks"
method: GET
path: "/blocks"
tags: ["Chain Data"]
---

# Get blocks

`GET /blocks`

Retrieve one or more blocks from the chain or local cache. Corresponds to the <a href="/chifra/chaindata/#chifra-blocks">chifra blocks</a> command line.

## Query parameters

- `blocks` string[], required
- `hashes` boolean
- `uncles` boolean
- `traces` boolean
- `uniq` boolean
- `flow` 'from' | 'to' | 'reward'
- `logs` boolean
- `emitter` string[]
- `topic` string[]
- `withdrawals` boolean
- `articulate` boolean
- `count` boolean
- `cacheTxs` boolean
- `cacheTraces` boolean
- `chain` string
- `noHeader` boolean
- `cache` boolean
- `decache` boolean
- `ether` boolean
- `fmt` string

## Response `200`

returns the requested data

- object
  - `data` union[] — Produces <a href="/data-model/accounts/#appearance">Appearance</a>, <a href="/data-model/chaindata/#block">Block</a>, <a href="/data-model/chaindata/#blockcount">BlockCount</a>, <a href="/data-model/chaindata/#lightblock">LightBlock</a>, <a href="/data-model/chaindata/#log">Log</a>, <a href="/data-model/other/#message">Message</a>, <a href="/data-model/chaindata/#trace">Trace</a>, <a href="/data-model/chaindata/#traceaction">TraceAction</a>, <a href="/data-model/chaindata/#traceresult">TraceResult</a> or <a href="/data-model/chaindata/#withdrawal">Withdrawal</a> data. Corresponds to the <a href="/chifra/chaindata/#chifra-blocks">chifra blocks</a> command line.
    - union
      - Appearance — an appearance (`<blockNumber,transactionIndex>`) of an address anywhere on the chain (note that in some cases, not all fields will appear depending on the command)
        - `address` string, address — the address of the appearance
        - `blockNumber` number — the number of the block
        - `transactionIndex` number — the index of the transaction in the block
        - `traceIndex` number — the zero-based index of the trace in the transaction
        - `reason` string, string — the location in the data where the appearance was found
        - `timestamp` number — the timestamp for this appearance
        - `date` string, datetime — the timestamp as a date (calculated)
      - Block — block data as returned from the RPC (with slight enhancements)
        - `gasLimit` number — the system-wide maximum amount of gas permitted in this block
        - `hash` string, hash — the hash of the current block
        - `blockNumber` number — the number of the block
        - `parentHash` string, hash — hash of previous block
        - `miner` string, address — address of block's winning miner
        - `difficulty` number — the computational difficulty at this block
        - `timestamp` number — the Unix timestamp of the object
        - `date` string, datetime — the timestamp as a date (calculated)
        - `transactions` Transaction[] — a possibly empty array of transactions
          - `hash` string, hash — the hash of the transaction
          - `blockHash` string, hash — the hash of the block containing this transaction
          - `blockNumber` number — the number of the block
          - `transactionIndex` number — the zero-indexed position of the transaction in the block
          - `nonce` number — sequence number of the transactions sent by the sender
          - `timestamp` number — the Unix timestamp of the object
          - `date` string, datetime — the timestamp as a date (calculated)
          - `from` string, address — address from which the transaction was sent
          - `to` string, address — address to which the transaction was sent
          - `value` string, wei — the amount of wei sent with this transactions
          - `ether` string, ether — if --ether is specified, the value in ether (calculated)
          - `gasPrice` number — the number of wei per unit of gas the sender is willing to spend
          - `gas` number — the maximum number of gas allowed for this transaction
          - `input` string, bytes — byte data either containing a message or funcational data for a smart contracts. See the --articulate
          - `receipt` object
          - `statements` Statement[] — array of reconciliation statements (calculated)
            - `blockNumber` number — the number of the block
            - `transactionIndex` number — the zero-indexed position of the transaction in the block
            - `logIndex` number — the zero-indexed position the log in the block, if applicable
            - `transactionHash` string, hash — the hash of the transaction that triggered this reconciliation
            - `timestamp` number — the Unix timestamp of the object
            - `date` string, datetime — the timestamp as a date (calculated)
            - `asset` string, address — 0xeeee...eeee for ETH reconciliations, the token address otherwise
            - `symbol` string, string — either ETH, WEI, or the symbol of the asset being reconciled as extracted from the chain
            - `decimals` number — the value of `decimals` from an ERC20 contract or, if ETH or WEI, then 18
            - `spotPrice` number, float — the on-chain price in USD (or if a token in ETH, or zero) at the time of the transaction
            - `priceSource` string, string — the on-chain source from which the spot price was taken
            - `accountedFor` string, address — the address being accounted for in this reconciliation
            - `sender` string, address — the initiator of the transfer (the sender)
            - `recipient` string, address — the receiver of the transfer (the recipient)
            - `begBal` string, int256 — the on-chain or running beginning balance prior to the transaction (see notes about intra-block reconciliations)
            - `amountNet` string, int256 — totalIn - totalOut (calculated)
            - `endBal` string, int256 — the on-chain or running balance after the transaction (see notes about intra-block reconciliations)
            - `reconciled` boolean — true if `endBal === endBalCalc` and `begBal === prevBal`. `false` otherwise. (calculated)
            - `totalIn` string, int256 — the sum of the following `In` fields (calculated)
            - `amountIn` string, int256 — the top-level value of the incoming transfer for the accountedFor address
            - `internalIn` string, int256 — the internal value of the incoming transfer for the accountedFor address
            - `selfDestructIn` string, int256 — the incoming value of a self-destruct if recipient is the accountedFor address
            - `minerBaseRewardIn` string, int256 — the base fee reward if the miner is the accountedFor address
            - `minerNephewRewardIn` string, int256 — the nephew reward if the miner is the accountedFor address
            - `minerTxFeeIn` string, int256 — the transaction fee reward if the miner is the accountedFor address
            - `minerUncleRewardIn` string, int256 — the uncle reward if the miner who won the uncle block is the accountedFor address
            - `correctBegBalIn` string, int256 — for unreconciled transfers, increase in beginning balance need to match previous balance
            - `correctAmountIn` string, int256 — for unreconciled transfers, increase in the amount of a transfer
            - `correctEndBalIn` string, int256 — for unreconciled transfers, increase in ending balance need to match running balance or block balance
            - `prefundIn` string, int256 — at block zero (0) only, the amount of genesis income for the accountedFor address
            - `totalOut` string, int256 — the sum of the following `Out` fields (calculated)
            - `amountOut` string, int256 — the amount (in units of the asset) of regular outflow during this transaction
            - `internalOut` string, int256 — the value of any internal value transfers out of the accountedFor account
            - `correctBegBalOut` string, int256 — for unreconciled transfers, decrease in beginning balance need to match previous balance
            - `correctAmountOut` string, int256 — for unreconciled transfers, decrease in the amount of a transfer
            - `correctEndBalOut` string, int256 — for unreconciled transfers, decrease in ending balance need to match running balance or block balance
            - `selfDestructOut` string, int256 — the value of the self-destructed value out if the accountedFor address was self-destructed
            - `gasOut` string, int256 — if the transaction's original sender is the accountedFor address, the amount of gas expended
            - `prevBal` string, int256 — the account balance for the given asset for the previous reconciliation
            - `begBalDiff` string, int256 — difference between expected beginning balance and balance at last reconciliation, if non-zero, the reconciliation failed (calculated)
            - `endBalDiff` string, int256 — endBal - endBalCalc, if non-zero, the reconciliation failed (calculated)
            - `endBalCalc` string, int256 — begBal + amountNet (calculated)
            - `correctingReasons` string, string — for unreconciled transfers, the reasons for the correcting entries, if any
          - `articulatedTx` object
          - `hasToken` boolean — `true` if the transaction is token related, `false` otherwise
          - `isError` boolean — `true` if the transaction ended in error, `false` otherwise
          - `compressedTx` string, string — truncated, more readable version of the articulation (calculated)
        - `baseFeePerGas` number — the base fee for this block
        - `uncles` Hash[] — a possibly empty array of uncle hashes
        - `withdrawals` Withdrawal[] — a possibly empty array of withdrawals (post Shanghai)
          - `address` string, address — the recipient for the withdrawn ether
          - `amount` string, wei — a nonzero amount of ether given in gwei (1e9 wei)
          - `ether` string, ether — if --ether is specified, the amount in ether (calculated)
          - `blockNumber` number — the number of this block
          - `index` number — a monotonically increasing zero-based index that increments by 1 per withdrawal to uniquely identify each withdrawal
          - `timestamp` number — the timestamp for this block
          - `date` string, datetime — the timestamp as a date (calculated)
          - `validatorIndex` number — the validator_index of the validator on the consensus layer the withdrawal corresponds to
      - BlockCount — counts of various parts of the block data such as tx_count, trace_count, etc.
        - `blockNumber` number — the block's block number
        - `timestamp` number — the timestamp of the block
        - `date` string, datetime — the timestamp as a date (calculated)
        - `transactionsCnt` number — the number transactions in the block
        - `unclesCnt` number — the number of uncles in the block
        - `logsCnt` number — the number of logs in the block
        - `tracesCnt` number — the number of traces in the block
        - `withdrawalsCnt` number — the number of withdrawals in the block
        - `addressCnt` number — the number of address appearances in the block
      - LightBlock — a block containing only the hashes of the transactions
        - `gasLimit` number — the system-wide maximum amount of gas permitted in this block
        - `hash` string, hash — the hash of the current block
        - `blockNumber` number — the number of the block
        - `parentHash` string, hash — hash of previous block
        - `miner` string, address — address of block's winning miner
        - `difficulty` number — the computational difficulty at this block
        - `timestamp` number — the Unix timestamp of the object
        - `date` string, datetime — the timestamp as a date (calculated)
        - `transactions` String[] — a possibly empty array of transaction hashes
        - `baseFeePerGas` number — the base fee for this block
        - `uncles` Hash[] — a possibly empty array of uncle hashes
        - `withdrawals` Withdrawal[] — a possibly empty array of withdrawals (post Shanghai)
          - `address` string, address — the recipient for the withdrawn ether
          - `amount` string, wei — a nonzero amount of ether given in gwei (1e9 wei)
          - `ether` string, ether — if --ether is specified, the amount in ether (calculated)
          - `blockNumber` number — the number of this block
          - `index` number — a monotonically increasing zero-based index that increments by 1 per withdrawal to uniquely identify each withdrawal
          - `timestamp` number — the timestamp for this block
          - `date` string, datetime — the timestamp as a date (calculated)
          - `validatorIndex` number — the validator_index of the validator on the consensus layer the withdrawal corresponds to
      - Log — log data as returned from the RPC (with slight enhancements)
        - `blockNumber` number — the number of the block
        - `transactionIndex` number — the zero-indexed position of the transaction in the block
        - `logIndex` number — the zero-indexed position of this log relative to the block
        - `timestamp` number — the timestamp of the block this log appears in
        - `date` string, datetime — the timestamp as a date (calculated)
        - `address` string, address — the smart contract that emitted this log
        - `topics` Topic[] — first topic event signature up to 3 additional index parameters may appear
        - `data` string, bytes — any remaining un-indexed parameters to the event
        - `transactionHash` string, hash — the hash of the transction
        - `blockHash` string, hash — the hash of the block
        - `articulatedLog` object — a human-readable version of the topic and data fields
        - `compressedLog` string, string — a truncated, more readable version of the articulation (calculated)
        - `isNFT` boolean — true if the log is an NFT transfer (calculated)
      - Message — used for various responses when no real data is generated
        - `msg` string, string — the message
        - `num` number — a number if needed
      - Trace — trace data as returned from the RPC (with slight enhancements)
        - `blockHash` string, hash — the hash of the block containing this trace
        - `blockNumber` number — the number of the block
        - `timestamp` number — the timestamp of the block
        - `date` string, datetime — the timestamp as a date (calculated)
        - `transactionHash` string, hash — the transaction's hash containing this trace
        - `transactionIndex` number — the zero-indexed position of the transaction in the block
        - `traceAddress` Uint64[] — a particular trace's address in the trace tree
        - `subtraces` number — the number of children traces that the trace hash
        - `type` string, string — the type of the trace
        - `action` object — the trace action for this trace
        - `result` object — the trace result of this trace
        - `articulatedTrace` object — human readable version of the trace action input data
        - `compressedTrace` string, string — a compressed string version of the articulated trace (calculated)
      - TraceAction — trace action data as returned from the RPC (with slight enhancements)
        - `from` string, address — address from which the trace was sent
        - `to` string, address — address to which the trace was sent
        - `gas` number — the maximum number of gas allowed for this trace
        - `input` string, bytes — an encoded version of the function call
        - `callType` string, string — the type of call
        - `refundAddress` string, address — if the call type is self-destruct, the address to which the refund is sent
        - `rewardType` string, string — the type of reward
        - `value` string, wei — the value (in wei) of this trace action
        - `ether` string, ether — if --ether is specified, the value in ether (calculated)
        - `selfDestructed` string, address — `true` if the contract self-destructed, `false` otherwise
        - `balance` string, wei — if self-destructed, the balance of the contract at that time
        - `balanceEth` string, ether — if --ether is specified, the balance in ether (calculated)
      - TraceResult — trace result data as returned from the RPC (with slight enhancements)
        - `address` string, address — address of new contract, if any
        - `code` string, bytes — if this trace is creating a new smart contract, the byte code of that contract
        - `gasUsed` number — the amount of gas used by this trace
        - `output` string, bytes — the result of the call of this trace
      - Withdrawal — withdrawal record for post-Shanghai withdrawals from the consensus layer
        - `address` string, address — the recipient for the withdrawn ether
        - `amount` string, wei — a nonzero amount of ether given in gwei (1e9 wei)
        - `ether` string, ether — if --ether is specified, the amount in ether (calculated)
        - `blockNumber` number — the number of this block
        - `index` number — a monotonically increasing zero-based index that increments by 1 per withdrawal to uniquely identify each withdrawal
        - `timestamp` number — the timestamp for this block
        - `date` string, datetime — the timestamp as a date (calculated)
        - `validatorIndex` number — the validator_index of the validator on the consensus layer the withdrawal corresponds to

## Other responses

- `400` — bad input parameter

---

[API](https://skmtc.net/trueblocks/apis/trueblocks-api.md) · [All operations](https://skmtc.net/trueblocks/apis/trueblocks-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trueblocks/trueblocks-api/versions/2a176f1485a9/schema)
