For the complete documentation index, see llms.txt. This page is also available as Markdown.

blocks - Ethereum Classic

Query Ethereum Classic blocks with the GraphQL API.

Returns all blocks in an inclusive range from a starting number to an ending number (or the latest), each with the fields you select. Useful for batch indexing.

Schema

blocks(from: Long!, to: Long): [Block!]!

Arguments

Argument
Type
Description

from

Long!

First block number (inclusive)

to

Long

Last block number (inclusive); omit for the latest

Query

query {
  blocks(from: 21200000, to: 21200005) {
    number
    transactionCount
    gasUsed
  }
}

Example

Response

Response Fields

Field
Type
Description

[Block]

array

Blocks in the requested range, each with selected fields

Use Cases

  • Batch Indexing: Ingest a block range in one request

  • Backfill: Replay history for an indexer

  • Analytics: Aggregate metrics across blocks

Error Handling

Error
Message
Description

errors[]

range too large

The requested range exceeds the node's limit

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?