curl --compressed -X POST 'https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream' \
-H 'Content-Type: application/json' \
-d '{
"type": "tron",
"fromBlock": 79257136,
"toBlock": 79257200,
"fields": {
"block": { "number": true, "timestamp": true },
"log": {
"address": true,
"topics": true,
"data": true,
"transactionIndex": true,
"logIndex": true
}
},
"logs": [{
"address": ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
"topic0": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}]
}'import requests
response = requests.post(
"https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream",
json={
"type": "tron",
"fromBlock": 79257136,
"toBlock": 79257200,
"fields": {
"block": {"number": True, "timestamp": True},
"log": {
"address": True,
"topics": True,
"data": True,
"transactionIndex": True,
"logIndex": True,
},
},
"logs": [{
"address": ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
"topic0": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
}],
},
)
blocks = [
__import__("json").loads(line)
for line in response.text.splitlines()
if line
]const response = await fetch("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type: "tron",
fromBlock: 79257136,
toBlock: 79257200,
fields: {
block: { number: true, timestamp: true },
log: {
address: true,
topics: true,
data: true,
transactionIndex: true,
logIndex: true,
},
},
logs: [{
address: ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
topic0: ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
}],
}),
});
const text = await response.text();
const blocks = text.split("\n").filter(Boolean).map((line) => JSON.parse(line));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'tron',
'fromBlock' => 79257136,
'toBlock' => 79257200,
'fields' => [
'block' => [
'number' => true,
'timestamp' => true
],
'log' => [
'address' => true,
'topics' => true,
'data' => true,
'transactionIndex' => true,
'logIndex' => true
]
],
'logs' => [
[
'address' => [
'a614f803b6fd780986a42c78ec9c7f77e6ded13c'
],
'topic0' => [
'ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream"
payload := strings.NewReader("{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"header": {
"number": 79257136,
"hash": "0000000004b95e300d9e52d878f88dba9776017f01923b8ab8c3680fc49b0771",
"timestamp": 1768435116000
},
"logs": [
{
"transactionIndex": 2,
"logIndex": 0,
"address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"data": "00000000000000000000000000000000000000000000000000000003c4a67e65",
"topics": [
"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"000000000000000000000000056d10e7b4ffd1ea56fd26f7ba5cedb3cf022ed7",
"000000000000000000000000201ec2a6830ce97884f284db2c080612de342806"
]
}
],
"transactions": [],
"internalTransactions": []
}
]"<string>""<string>""<string>"{
"previousBlocks": [
{
"number": 123,
"hash": "<string>"
}
]
}"<string>""<string>""<string>"Stream Finalized Blocks
Streams only finalized blocks matching the provided data query (never returns a 409 response). Query structure is identical to that of the /stream endpoint. Required request headers: Content-Type: application/json; optional request headers: Accept-Encoding: gzip, Content-Encoding: gzip.
curl --compressed -X POST 'https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream' \
-H 'Content-Type: application/json' \
-d '{
"type": "tron",
"fromBlock": 79257136,
"toBlock": 79257200,
"fields": {
"block": { "number": true, "timestamp": true },
"log": {
"address": true,
"topics": true,
"data": true,
"transactionIndex": true,
"logIndex": true
}
},
"logs": [{
"address": ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
"topic0": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}]
}'import requests
response = requests.post(
"https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream",
json={
"type": "tron",
"fromBlock": 79257136,
"toBlock": 79257200,
"fields": {
"block": {"number": True, "timestamp": True},
"log": {
"address": True,
"topics": True,
"data": True,
"transactionIndex": True,
"logIndex": True,
},
},
"logs": [{
"address": ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
"topic0": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
}],
},
)
blocks = [
__import__("json").loads(line)
for line in response.text.splitlines()
if line
]const response = await fetch("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type: "tron",
fromBlock: 79257136,
toBlock: 79257200,
fields: {
block: { number: true, timestamp: true },
log: {
address: true,
topics: true,
data: true,
transactionIndex: true,
logIndex: true,
},
},
logs: [{
address: ["a614f803b6fd780986a42c78ec9c7f77e6ded13c"],
topic0: ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],
}],
}),
});
const text = await response.text();
const blocks = text.split("\n").filter(Boolean).map((line) => JSON.parse(line));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'tron',
'fromBlock' => 79257136,
'toBlock' => 79257200,
'fields' => [
'block' => [
'number' => true,
'timestamp' => true
],
'log' => [
'address' => true,
'topics' => true,
'data' => true,
'transactionIndex' => true,
'logIndex' => true
]
],
'logs' => [
[
'address' => [
'a614f803b6fd780986a42c78ec9c7f77e6ded13c'
],
'topic0' => [
'ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream"
payload := strings.NewReader("{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://portal.sqd.dev/datasets/tron-mainnet/finalized-stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"tron\",\n \"fromBlock\": 79257136,\n \"toBlock\": 79257200,\n \"fields\": {\n \"block\": {\n \"number\": true,\n \"timestamp\": true\n },\n \"log\": {\n \"address\": true,\n \"topics\": true,\n \"data\": true,\n \"transactionIndex\": true,\n \"logIndex\": true\n }\n },\n \"logs\": [\n {\n \"address\": [\n \"a614f803b6fd780986a42c78ec9c7f77e6ded13c\"\n ],\n \"topic0\": [\n \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"header": {
"number": 79257136,
"hash": "0000000004b95e300d9e52d878f88dba9776017f01923b8ab8c3680fc49b0771",
"timestamp": 1768435116000
},
"logs": [
{
"transactionIndex": 2,
"logIndex": 0,
"address": "a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"data": "00000000000000000000000000000000000000000000000000000003c4a67e65",
"topics": [
"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"000000000000000000000000056d10e7b4ffd1ea56fd26f7ba5cedb3cf022ed7",
"000000000000000000000000201ec2a6830ce97884f284db2c080612de342806"
]
}
],
"transactions": [],
"internalTransactions": []
}
]"<string>""<string>""<string>"{
"previousBlocks": [
{
"number": 123,
"hash": "<string>"
}
]
}"<string>""<string>""<string>"Body
Data query to filter and retrieve finalized blocks. Request body may be gzipped (Content-Encoding: gzip).
The type of blockchain data (fixed to Tron for this API).
tron The block number to start fetching from (inclusive).
The block number to fetch up to (inclusive). Optional; if omitted, streams until dataset height or timeout.
Expected hash of the parent of the first requested block.
If true, includes blocks with no matching data in the response.
Field selector for data items to retrieve.
Show child attributes
Show child attributes
Transaction data requests. Matches transactions by contract type.
Show child attributes
Show child attributes
Native TRX transfer requests (TransferContract). Addresses are 41-prefixed lowercase hex.
Show child attributes
Show child attributes
TRC-10 asset transfer requests (TransferAssetContract).
Show child attributes
Show child attributes
Smart-contract call requests (TriggerSmartContract). Covers TRC-20 and all other contract interactions.
Show child attributes
Show child attributes
Log data requests (TVM event logs).
Show child attributes
Show child attributes
Internal transaction data requests.
Show child attributes
Show child attributes
Response
A stream of finalized 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.
Block header data. Fields are conditionally returned based on the fields.block parameter in the request. Only requested fields will be included in the response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?