Skip to main content
POST
/
api
/
v1
/
customer
/
{chain}
/
blocks
/
filter
curl --request POST \
  --url https://api-gateway.sonarx.com/api/v1/customer/{chain}/blocks/filter \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "from_block": 81901160,
  "to_block": 81901165,
  "full_transactions": false
}
'
{
  "from_block": 81901160,
  "to_block": 81901165,
  "from_datetime": null,
  "to_datetime": null,
  "offset": 0,
  "limit": 10,
  "result": [
    {
      "block_number": 81901165,
      "timestamp": 1768922302,
      "datetime": "2026-01-20T15:18:22",
      "block_hash": "0x70977f71168a51813978584b23cccd0fa86cdc1239ab403feafc68e85733af1a",
      "block_parent_hash": "0x8ee5ee7b7256f12f985f8dcdc2a3ca26a494be30ca6ba379cba2a5a06c6cd311",
      "version": 0,
      "transactions_root": "0xb11abe9386303f977bbfa935f4b2c4924a45b41095c24b207828c12e2cb7f058",
      "state_root": "0x7850f2b1d88f135ca3b7506add74ab738c168748ce825543d43d49ad2471c584",
      "receipts_root": "0x74dd7cda82d48726b16c25560a00d11d37e525e35c060b6958e7350a53b47dd1",
      "miner": "0x0000000000000000000000000000000000000000",
      "size": 188062,
      "gas_limit": 65000000,
      "gas_used": 39500751,
      "transaction_count": 176,
      "base_fee_per_gas": 600795160350
    },
    {
      "block_number": 81901164,
      "timestamp": 1768922300,
      "datetime": "2026-01-20T15:18:20",
      "block_hash": "0x8ee5ee7b7256f12f985f8dcdc2a3ca26a494be30ca6ba379cba2a5a06c6cd311",
      "block_parent_hash": "0x33031d51e8f973d2465ba1fd1245e9db6fe07561c55d6288161fb7b077e6e769",
      "version": 0,
      "transactions_root": "0x799caf39ec0ba4cfd7d9eead83ffd32df1f863022917a94df55a3e629a9410f9",
      "state_root": "0xe45b0784f2b8a452725bf82ef9a4c722e54a0ffb19a2696ab04e88a2a16fba19",
      "receipts_root": "0x29e8ad9db7df634df6c7b9bdb2dda16090086793e71dfa81252070caab69b8f8",
      "miner": "0x0000000000000000000000000000000000000000",
      "size": 175432,
      "gas_limit": 65000000,
      "gas_used": 34100066,
      "transaction_count": 152,
      "base_fee_per_gas": 602611448639
    }
  ],
  "count": 6
}

Documentation Index

Fetch the complete documentation index at: https://docs.sonarx.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

apikey
string
header
required

API key for authentication. Contact SonarX to obtain your API key.

Path Parameters

chain
enum<string>
required

The blockchain network to query

Available options:
polygon
Example:

"polygon"

Query Parameters

limit
integer
default:10

Maximum number of results (1-50)

Required range: 1 <= x <= 50
offset
integer
default:0

Number of results to skip for pagination

Required range: x >= 0

Body

application/json

Request body for filtering blocks. Validation rules: (1) Must provide either block range OR datetime range, not both and not neither. (2) When using block range, both from_block AND to_block are required. (3) When using datetime range, both from_datetime AND to_datetime are required. (4) to_block must be >= from_block. (5) to_datetime must be >= from_datetime. (6) Block range cannot exceed 100 blocks.

from_block
integer

Start block number. Required if using block range.

Required range: x >= 0
to_block
integer

End block number. Required if using block range. Must be >= from_block and within 100 blocks of from_block.

Required range: x >= 0
from_datetime
string<date-time>

Start datetime (ISO 8601, timezone required, e.g., 2024-01-15T10:30:00Z or 2024-01-15T10:30:00+00:00). Required if using datetime range.

to_datetime
string<date-time>

End datetime (ISO 8601, timezone required, e.g., 2024-01-15T10:30:00Z or 2024-01-15T10:30:00+00:00). Required if using datetime range. Must be >= from_datetime.

full_transactions
boolean
default:false

Include full transaction objects

Response

Filtered blocks

from_block
integer | null
to_block
integer | null
from_datetime
string | null
to_datetime
string | null
offset
integer
limit
integer
result
object[]
count
integer