TriportRPC

eth_getLogs

BNB Smart Chain / https://triport.io/rpc/bsc

Minimum tier: Pro

BNB Smart Chain method guide

Last updated:

eth_getLogs returns BNB Smart Chain event logs matching one address/topic filter and either a block range or a block hash.

Use it for bounded event indexing and contract-event lookups. Topics are positional and support a hash, null, or an array of hashes per position. blockHash must not be combined with fromBlock according to the OpenRPC schema.

This pool has per-node limits: the limited class accepts 25 blocks and rejects 50, while two standard classes accept 100 blocks and reject 1,000. One standard class requires address. Split wider queries before sending them so routing can honor the selected node's capability.

Parameters

eth_getLogs parameters
NameTypeRequiredDescription
filterLogFilterYesPer-node maximum range is ≤ 100 blocks; address is required by some nodes.

Returns

eth_getLogs return value
FieldType
logsLogList

Examples

curl https://triport.io/rpc/bsc \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":["<filter>"]}'
const res = await fetch("https://triport.io/rpc/bsc", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    "<filter>"
  ]
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/rpc/bsc",
    headers={"Authorization": "Bearer <api-key>"},
    json={"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":["<filter>"]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: BNB Smart Chain.
  3. Clusters: mainnet.
  4. Credit cost: 5 per call.

FAQ

What does eth_getLogs do?
Return event logs matching a filter.
How many credits does eth_getLogs cost?
eth_getLogs costs 5 credit(s) per call on Triport by default.
Is eth_getLogs available over WebSocket?
eth_getLogs is an HTTP JSON-RPC method.