eth_getLogs
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"id": 1,
"params": [
{
"fromBlock": "0x1",
"toBlock": "0x2",
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"topics": [
"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
]
}
]
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc"
payload = {
"jsonrpc": "2.0",
"method": "eth_getLogs",
"id": 1,
"params": [
{
"fromBlock": "0x1",
"toBlock": "0x2",
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"]
}
]
}
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({
jsonrpc: '2.0',
method: 'eth_getLogs',
id: 1,
params: [
{
fromBlock: '0x1',
toBlock: '0x2',
address: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
topics: ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b']
}
]
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc', 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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc",
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([
'jsonrpc' => '2.0',
'method' => 'eth_getLogs',
'id' => 1,
'params' => [
[
'fromBlock' => '0x1',
'toBlock' => '0x2',
'address' => '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
'topics' => [
'0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b'
]
]
]
]),
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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc")
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 \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": "<array>"
}TRON node API
jsonrpc eth_getLogs | TRON
TRON API method that returns an array of logs matching the specified filter criteria. This method provides Ethereum-compatible interface for TRON blockchain.
POST
/
95e61622bf6a8af293978377718e3b77
/
jsonrpc
eth_getLogs
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"id": 1,
"params": [
{
"fromBlock": "0x1",
"toBlock": "0x2",
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"topics": [
"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"
]
}
]
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc"
payload = {
"jsonrpc": "2.0",
"method": "eth_getLogs",
"id": 1,
"params": [
{
"fromBlock": "0x1",
"toBlock": "0x2",
"address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"]
}
]
}
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({
jsonrpc: '2.0',
method: 'eth_getLogs',
id: 1,
params: [
{
fromBlock: '0x1',
toBlock: '0x2',
address: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
topics: ['0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b']
}
]
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc', 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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc",
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([
'jsonrpc' => '2.0',
'method' => 'eth_getLogs',
'id' => 1,
'params' => [
[
'fromBlock' => '0x1',
'toBlock' => '0x2',
'address' => '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
'topics' => [
'0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b'
]
]
]
]),
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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc")
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 \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getLogs\",\n \"id\": 1,\n \"params\": [\n {\n \"fromBlock\": \"0x1\",\n \"toBlock\": \"0x2\",\n \"address\": \"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\",\n \"topics\": [\n \"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "<string>",
"id": 123,
"result": "<array>"
}TRON API method that retrieves event logs based on filter criteria, providing an Ethereum-compatible interface for accessing TRON blockchain data.
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
jsonrpc— the JSON-RPC protocol version (always “2.0”)method— the method name (always “eth_getLogs”)params— array containing method parametersfilterObject— object containing filter criteria including fromBlock, toBlock, address, and topics
id— request identifier (number or string)
Response
jsonrpc— the JSON-RPC protocol version (“2.0”)id— the request identifier that matches the requestresult— array of log objects matching the filter criteria
Use case
Thejsonrpc eth_getLogs method is used for:
- Retrieving smart contract event logs for dApp functionality through Web3 interfaces
- Building event-driven applications that react to on-chain activities
- Implementing transaction and event monitoring systems for compliance and analytics
- Creating blockchain explorers and audit tools that track contract interactions
Body
application/json
Last modified on June 22, 2026
Was this page helpful?