Skip to main content

Substrate SQD Network API

The Substrate API of SQD Network is currently in beta. Breaking changes may be introduced in the future releases.
SQD Network API distributes the requests over a (potentially decentralized) network of workers. The main gateway URL points at a router that provides URLs of workers that do the heavy lifting. Each worker has its own range of blocks on each dataset it serves. Suppose you want to retrieve an output of some query on a block range starting at firstBlock (can be the genesis block) and ending at the highest available block. Proceed as follows:
  1. Retrieve the dataset height from the router with GET /height and make sure it’s above firstBlock.
  2. Save the value of firstBlock to some variable, say currentBlock.
  3. Query the router for an URL of a worker that has the data for currentBlock with GET /$\{currentBlock\}/worker.
  4. Retrieve the data from the worker by posting the query (POST /), setting the "fromBlock" query field to $\{currentBlock\}.
  5. Parse the retrieved data to get a batch of query data plus the height of the last block available from the current worker. Take the header.number field of the last element of the retrieved JSON array - it is the height you want. Even if your query returns no data, you’ll still get the block data for the last block in the range, so this procedure is safe.
  6. Set currentBlock to the height from the previous step plus one.
  7. Repeat steps 3-6 until all the required data is retrieved.
Main URLs of EVM gateways are available on the Supported networks page. Implementation example:

Router API

Worker API

Last modified on November 17, 2025