Skip to main content
POST
/
stream
curl --compressed -X POST 'https://portal.sqd.dev/datasets/polkadot/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "substrate",
    "fromBlock": 20000000,
    "toBlock": 20000100,
    "fields": {
      "block": {
        "number": true,
        "timestamp": true
      },
      "event": {
        "name": true,
        "args": true
      }
    },
    "events": [{
      "name": ["Balances.Transfer"]
    }]
  }'
[
  {
    "header": {
      "number": 20000050,
      "hash": "0xabc123def456789abc123def456789abc123def456789abc123def456789abcd",
      "parentHash": "0x789012abc345678901234567890123456789012345678901234567890123abcd",
      "timestamp": 1700000000000
    },
    "events": [
      {
        "index": 3,
        "extrinsicIndex": 1,
        "name": "Balances.Transfer",
        "phase": "ApplyExtrinsic",
        "args": {
          "from": "15oF4uVJwmo4TdGW7VfQxNLavjCXviqWrztPu9BFKHEtaqry",
          "to": "14E5nqKAp3oAJcg4aM6hEYyLT2JAPi6ixST1VRkNg8wAKPe",
          "amount": "10000000000"
        }
      }
    ]
  }
]

Documentation Index

Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt

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

Real-time streaming is not supported for Substrate chains. Only finalized historical data is available. If you need real-time Substrate data, schedule a call with our team.

Body

application/json

Data query to filter and retrieve blocks

fromBlock
integer<int64>
default:20000000
required

The number of the first block to fetch. If unsure how far into the past this can go consult /metadata

type
enum<string>
default:substrate
Available options:
substrate
toBlock
integer<int64>
default:20000100

The number of the last block to fetch (inclusive)

parentBlockHash
string

Expected hash of the parent of the first requested block

includeAllBlocks
boolean
default:false

If true, includes blocks with no matching data

fields
object

Field selector. See the HTTP 200 response description for details on fields that aren't self-explanatory

events
object[]

Event data requests. An empty object matches all events; an empty array matches no events

calls
object[]

Call data requests. An empty object matches all calls; an empty array matches no calls

evmLogs
object[]

EVM.Log event requests for Frontier EVM parachains (e.g. Moonbeam, Astar). Filters on EVM.Log events specifically

ethereumTransactions
object[]

Ethereum.transact call requests for Frontier EVM parachains. Filters on Ethereum.transact calls specifically

contractsEvents
object[]

Contracts.ContractEmitted event requests for ink! smart contracts. Contract addresses must be hexadecimal (decoded from SS58) and lowercase

gearMessagesEnqueued
object[]

Gear.UserMessageEnqueued event requests for Gear/Vara networks

gearUserMessagesSent
object[]

Gear.UserMessageSent event requests for Gear/Vara networks

reviveContractEmitted
object[]

Revive.ContractEmitted event requests for Revive smart contracts

Response

A stream of blocks in JSON lines format, optionally gzipped. Can be empty if the data query has a bounded range and all blocks in the range have been skipped. May include X-Sqd-Finalized-Head-Number and X-Sqd-Finalized-Head-Hash headers, indicating the latest finalized block that's on the same chain as the returned blocks.

header
object
required
extrinsics
object[]
calls
object[]
events
object[]