trace_filter
curl --request POST \
--url https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x3480c62",
"toBlock": "0x3480c62"
}
]
}
'import requests
url = "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x3480c62",
"toBlock": "0x3480c62"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'trace_filter',
params: [{fromBlock: '0x3480c62', toBlock: '0x3480c62'}]
})
};
fetch('https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/",
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([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'trace_filter',
'params' => [
[
'fromBlock' => '0x3480c62',
'toBlock' => '0x3480c62'
]
]
]),
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://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\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://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
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 \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x19d7cf8ea0ce468417d1eda365a222a9dcbc7d27",
"callType": "call",
"gas": "0x8d1c0",
"input": "0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000",
"to": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0x6f50",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "delegatecall",
"gas": "0x89bee",
"input": "0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000",
"to": "0xd206ac7fef53d83ed4563e770b28dba90d0d9ec8",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0x5c52",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 2,
"traceAddress": [
0
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "staticcall",
"gas": "0x7530",
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
"to": "0x1ff9c167b50d05910ffdadb82d3d2da4508330ca",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"result": {
"gasUsed": "0xf1",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0,
0
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "call",
"gas": "0x82a56",
"input": "0x0a617bee",
"to": "0x1ff9c167b50d05910ffdadb82d3d2da4508330ca",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0xb84",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 0,
"traceAddress": [
0,
1
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
}
]
}Arc node API
trace_filter | Arc
Arc API method that returns execution traces matching specific filter criteria. Available on Arc via Chainstack JSON-RPC nodes.
POST
/
trace_filter
curl --request POST \
--url https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x3480c62",
"toBlock": "0x3480c62"
}
]
}
'import requests
url = "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x3480c62",
"toBlock": "0x3480c62"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'trace_filter',
params: [{fromBlock: '0x3480c62', toBlock: '0x3480c62'}]
})
};
fetch('https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/",
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([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'trace_filter',
'params' => [
[
'fromBlock' => '0x3480c62',
'toBlock' => '0x3480c62'
]
]
]),
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://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\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://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
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 \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_filter\",\n \"params\": [\n {\n \"fromBlock\": \"0x3480c62\",\n \"toBlock\": \"0x3480c62\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"action": {
"from": "0x19d7cf8ea0ce468417d1eda365a222a9dcbc7d27",
"callType": "call",
"gas": "0x8d1c0",
"input": "0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000",
"to": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0x6f50",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "delegatecall",
"gas": "0x89bee",
"input": "0xb61d27f60000000000000000000000001ff9c167b50d05910ffdadb82d3d2da4508330ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000040a617bee00000000000000000000000000000000000000000000000000000000",
"to": "0xd206ac7fef53d83ed4563e770b28dba90d0d9ec8",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0x5c52",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 2,
"traceAddress": [
0
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "staticcall",
"gas": "0x7530",
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
"to": "0x1ff9c167b50d05910ffdadb82d3d2da4508330ca",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"result": {
"gasUsed": "0xf1",
"output": "0x"
},
"subtraces": 0,
"traceAddress": [
0,
0
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"from": "0xd011948bd0d6d433d4ba6df9dc44eb9a2bfa555f",
"callType": "call",
"gas": "0x82a56",
"input": "0x0a617bee",
"to": "0x1ff9c167b50d05910ffdadb82d3d2da4508330ca",
"value": "0x0"
},
"blockHash": "0xa86891cc8ae2e3efe67b21e24f8f852e76a0875892e9e8c9a4c77aab8e2761cc",
"blockNumber": 55053410,
"error": "Reverted",
"result": {
"gasUsed": "0xb84",
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000012"
},
"subtraces": 0,
"traceAddress": [
0,
1
],
"transactionHash": "0xfc48f7c70e8ffaa46b1110dc43f32e90f65434a0949edab384d066c820c57ee2",
"transactionPosition": 0,
"type": "call"
}
]
}Arc API method that returns execution traces matching specific filter criteria. This is useful for finding all interactions with a specific contract or address across multiple blocks.
The following example finds all calls to the pathUSD token contract:
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
filterObject— the filter object:fromBlock— (optional) starting block number (hex)toBlock— (optional) ending block number (hex)fromAddress— (optional) array of sender addresses to filtertoAddress— (optional) array of recipient addresses to filterafter— (optional) offset for paginationcount— (optional) maximum number of traces to return
Response
result— array of trace objects matching the filter:action— the action object:from— sender addressto— recipient addresscallType— type of callgas— gas providedinput— call datavalue— value transferred
blockHash— hash of the blockblockNumber— block numberresult— the result objectsubtraces— number of child tracestraceAddress— position in the trace treetransactionHash— hash of the transactiontransactionPosition— index in the blocktype— trace type
trace_filter code examples
The following example finds all calls to the pathUSD token contract:
const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const traceFilter = async () => {
const currentBlock = await provider.getBlockNumber();
const fromBlock = "0x" + (currentBlock - 1000).toString(16);
const toBlock = "0x" + currentBlock.toString(16);
const traces = await provider.send("trace_filter", [{
fromBlock: fromBlock,
toBlock: toBlock,
toAddress: [PATHUSD],
count: 20
}]);
console.log(`Found ${traces.length} traces to pathUSD`);
for (const trace of traces) {
console.log(`Block ${trace.blockNumber}: ${trace.action.from} -> ${trace.action.to}`);
console.log(` Call type: ${trace.action.callType}`);
console.log(` Tx: ${trace.transactionHash}`);
}
};
traceFilter();
from web3 import Web3
node_url = "CHAINSTACK_NODE_URL"
web3 = Web3(Web3.HTTPProvider(node_url))
# pathUSD token address
PATHUSD = "0x20c0000000000000000000000000000000000000"
current_block = web3.eth.block_number
from_block = hex(current_block - 1000)
to_block = hex(current_block)
result = web3.provider.make_request("trace_filter", [{
"fromBlock": from_block,
"toBlock": to_block,
"toAddress": [PATHUSD],
"count": 20
}])
traces = result['result']
print(f"Found {len(traces)} traces to pathUSD")
for trace in traces:
print(f"Block {trace['blockNumber']}: {trace['action']['from']} -> {trace['action']['to']}")
print(f" Call type: {trace['action']['callType']}")
print(f" Tx: {trace['transactionHash']}")
curl -X POST "CHAINSTACK_NODE_URL" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [{
"fromBlock": "0x564000",
"toBlock": "0x565000",
"toAddress": ["0x20c0000000000000000000000000000000000000"],
"count": 20
}],
"id": 1
}'
Last modified on August 3, 2026
Was this page helpful?
⌘I