block - Ethereum Classic

Returns a block by its number or hash (or the latest block when neither is given), letting you select exactly the header fields and nested transactions you need in one request.

Schema

graphqlblock(number: Long, hash: Bytes32): Block

Arguments

ArgumentTypeDescription
numberLongBlock number; omit for the latest block
hashBytes32Block hash (mutually exclusive with number)

Query

graphqlquery {
  block(number: 21200000) {
    number
    hash
    timestamp
    gasUsed
    gasLimit
    miner { address }
    transactionCount
  }
}

Example

bashexport ETC_GRAPHQL=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/

curl --location --request POST "${ETC_GRAPHQL}graphql" \
--header 'Content-Type: application/json' \
--data-raw '{"query": "query { block(number: 21200000) { number hash timestamp gasUsed gasLimit miner { address } transactionCount } }"}'

Response

json{
    "data": {
        "block": {
            "number": 21200000,
            "hash": "0x1a2b...",
            "timestamp": 1730000000,
            "gasUsed": 1200000,
            "gasLimit": 8000000,
            "miner": {
                "address": "0x82A618305706B14e7bcf2592D4B9324A366b6dAd"
            },
            "transactionCount": 12
        }
    }
}

Response Fields

FieldTypeDescription
numberLongBlock number
hashBytes32Block hash
minerAccountBlock producer account
transactionCountIntNumber of transactions in the block

Use Cases

  • Selective Reads: Fetch only the block fields you need
  • Explorers: Render block pages with nested data
  • Indexing: Pull block + transactions in one round trip

Error Handling

ErrorMessageDescription
errors[]block not foundNo block matches the number or hash
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect