Skip to main content
POST
/
api
/
v1
/
customer
/
{chain}
/
traces
/
filter
curl --request POST \
  --url https://api-gateway.sonarx.com/api/v1/customer/{chain}/traces/filter \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "from_block": 81901160,
  "to_block": 81901165
}
'
{
  "offset": 0,
  "limit": 10,
  "result": [
    {
      "block_number": 81901160,
      "timestamp": 1768922292,
      "datetime": "2026-01-20T15:18:12",
      "transaction_hash": "0x2e8c9673c8d527e105a0b24036f2f0a1acbb0cb428a8360a8d9a1cf42419e9c6",
      "transaction_index": 0,
      "trace_address": "",
      "transaction_from": "0xca8762c845a00d5c162a5ea0c53d4a49459133f9",
      "transaction_to": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
      "transaction_status": true,
      "call_type": "call",
      "from_address": "0xca8762c845a00d5c162a5ea0c53d4a49459133f9",
      "to_address": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
      "gas": 76872,
      "gas_used": 30602,
      "gas_refund": 46270,
      "value": "0",
      "subtraces": 1,
      "type": "call",
      "input": "0x23b872dd0000000000000000000000006908194b2a96dc0dade8840bf911511a34801796000000000000000000000000c3eafcbd3fbcd393e3b80b3a87a8626a1934ba060000000000000000000000000000000000000000000000000000000001749c81",
      "output": "0x0000000000000000000000000000000000000000000000000000000000000001",
      "error": null,
      "function_signature": "0x23b872dd",
      "version": 0
    }
  ],
  "count": 1
}
Polygon Data Availability: Polygon traces are only available from January 2025 onwards.
Block Range Limit: Block range queries cannot exceed 100 blocks.
Range Filter Constraint: Use either block range (from_block/to_block) OR datetime range (from_datetime/to_datetime), but not both simultaneously. These filter pairs are mutually exclusive.

Authorizations

apikey
string
header
required

API key for authentication

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 traces. 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.

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.

from_address

Sender address(es) to filter by (max 10 addresses)

to_address

Recipient address(es) to filter by (max 10 addresses)

Response

Filtered traces

offset
integer
limit
integer
result
object[]
count
integer