Read event logs with eth_getLogs
You need events emitted by a contract — Transfer, Swap, or any topic — over a block range. Standard eth_getLogs works unchanged against our RPC, or use the REST logs endpoint for a decoded shape. Wide ranges hit archive depth and are served without you hosting a node.
- An API key (sk_live_...) with read access.
- A contract address and the topic0 hash you want to filter on.
1Query logs over JSON-RPC
POST eth_getLogs to /v1/rpc/eth with an address, topic filter and block range. This is the standard method — only the base URL and Bearer header change.
curl https://api.1st-node.com/v1/rpc/eth \
-H "Authorization: Bearer sk_live_..." \
-d '{"method":"eth_getLogs","params":[{"address":"0xA0b8...eB48","topics":["0xddf252ad..."],"fromBlock":"0x12d687","toBlock":"0x12d7a5"}]}'2Or use the decoded REST logs endpoint
GET /logs with address and topic0 query params to get logs in a flat, decoded shape without building the RPC envelope.
curl "https://api.1st-node.com/v1/data/eth/logs?address=0xA0b8...eB48&topic0=0xddf252ad..." \ -H "Authorization: Bearer sk_live_..."
3Handle wide ranges
Split very large ranges into windows to keep responses bounded. Deep historical windows are archive-depth (C2), served from our archive nodes at per-call cost.
> {
> "logs": [
> { "block": 1234567, "address": "0xA0b8...eB48", "topic0": "0xddf252ad...", "data": "0x...", "txHash": "0x8f2a...c91b" }
> ]
> }Sıkça sorulanlar
Does eth_getLogs work the same as on a self-hosted node?
Yes. It is standard JSON-RPC — swap the base URL to /v1/rpc/eth and add the Bearer header. No node to run.
Can I query logs from years ago?
Yes. Old block ranges are served from our own archive nodes at archive-depth tier (C2). You pay per call rather than maintaining an archive node.
Okumaya devam et
Bakiye yükle, anahtarını al, yayına çık.
Self servis. Kripto ya da kartla öde. Krediyle ölçümlenir — ağır ilkel yapılar daha pahalı, basitler ucuz.
API anahtarı al