eth_getLogs RPC Method
Please be aware that the block range limit for this RPC method is 5 blocks for users on the Free Trial plan and 10,000 blocks for those on paid plans. Consider dividing your queries into smaller segments to enhance response times and manage errors more effectively. For further details on the block range limit and strategies for mitigating it, please consult the FAQ
Parameters
object
object
Loading...
fromBlock
string
Loading...
toBlock
string
Loading...
address
string
Loading...
topics
array
Loading...
blockHash
string
Loading...
Returns
result
Loading...
address
string
Loading...
topics
array
Loading...
data
string
Loading...
blockNumber
string
Loading...
transactionHash
string
Loading...
transactionIndex
string
Loading...
blockHash
string
Loading...
logIndex
string
Loading...
removed
boolean
Loading...
Request
1curl -X POST "https://docs-demo.zksync-mainnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_getLogs",6"params": [7{8"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"9}10],11"id": 112}'
1curl -X POST "https://docs-demo.zksync-mainnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_getLogs",6"params": [7{8"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"9}10],11"id": 112}'
1import { ethers } from "ethers";23async function main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.zksync-mainnet.quiknode.pro/");5const response = await provider.send("eth_getLogs", [6{7"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"8}9]);10console.log(response);11}1213main();
1import { ethers } from "ethers";23async function main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.zksync-mainnet.quiknode.pro/");5const response = await provider.send("eth_getLogs", [6{7"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"8}9]);10console.log(response);11}1213main();
1require 'eth'23client = Eth::Client.create 'https://docs-demo.zksync-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_getLogs",7"params": [8{9"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"10}11],12"id": "1"13}1415response = client.send(payload.to_json)16puts response
1require 'eth'23client = Eth::Client.create 'https://docs-demo.zksync-mainnet.quiknode.pro/'4payload = {5"jsonrpc": "2.0",6"method": "eth_getLogs",7"params": [8{9"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"10}11],12"id": "1"13}1415response = client.send(payload.to_json)16puts response
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.zksync-mainnet.quiknode.pro/'))3response = w3.provider.make_request("eth_getLogs", [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}])4print(response)
1from web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.zksync-mainnet.quiknode.pro/'))3response = w3.provider.make_request("eth_getLogs", [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}])4print(response)
1import { createPublicClient, http } from 'viem'23async function main() {4const client = createPublicClient({5transport: http('https://docs-demo.zksync-mainnet.quiknode.pro/')6})78const result = await client.request({9method: 'eth_getLogs',10params: [11{12"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"13}14]15})1617console.log(result)18}1920main()
1import { createPublicClient, http } from 'viem'23async function main() {4const client = createPublicClient({5transport: http('https://docs-demo.zksync-mainnet.quiknode.pro/')6})78const result = await client.request({9method: 'eth_getLogs',10params: [11{12"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"13}14]15})1617console.log(result)18}1920main()
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.zksync-mainnet.quiknode.pro/",5})67core.client8.request({9method: 'eth_getLogs',10params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}]11})12.then(res => console.log(res))
1import { Core } from '@quicknode/sdk'23const core = new Core({4endpointUrl: "https://docs-demo.zksync-mainnet.quiknode.pro/",5})67core.client8.request({9method: 'eth_getLogs',10params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}]11})12.then(res => console.log(res))
1const body = {2jsonrpc: '2.0',3method: 'eth_getLogs',4params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}],5id: 16}78async function main() {9const response = await fetch('https://docs-demo.zksync-mainnet.quiknode.pro/', {10method: 'POST',11headers: {'Content-Type': 'application/json'},12body: JSON.stringify(body)13})14const data = await response.json()15console.log(data)16}1718main()
1const body = {2jsonrpc: '2.0',3method: 'eth_getLogs',4params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}],5id: 16}78async function main() {9const response = await fetch('https://docs-demo.zksync-mainnet.quiknode.pro/', {10method: 'POST',11headers: {'Content-Type': 'application/json'},12body: JSON.stringify(body)13})14const data = await response.json()15console.log(data)16}1718main()
1import requests2import json34url = "https://docs-demo.zksync-mainnet.quiknode.pro/"56payload = json.dumps({7"jsonrpc": "2.0",8"method": "eth_getLogs",9"params": [10{11"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"12}13],14"id": 115})16headers = {17'Content-Type': 'application/json'18}1920response = requests.request("POST", url, headers=headers, data=payload)2122print(response.text)
1import requests2import json34url = "https://docs-demo.zksync-mainnet.quiknode.pro/"56payload = json.dumps({7"jsonrpc": "2.0",8"method": "eth_getLogs",9"params": [10{11"address": "0xB949b4E3945628650862a29Abef3291F2eD52471"12}13],14"id": 115})16headers = {17'Content-Type': 'application/json'18}1920response = requests.request("POST", url, headers=headers, data=payload)2122print(response.text)
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.zksync-mainnet.quiknode.pro/")67payload = {8jsonrpc: "2.0",9id: 1,10method: "eth_getLogs",11params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}]12}1314request = Net::HTTP::Post.new(uri)15request["Content-Type"] = "application/json"16request.body = JSON.generate(payload)1718response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|19http.request(request)20end2122puts response.body
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.zksync-mainnet.quiknode.pro/")67payload = {8jsonrpc: "2.0",9id: 1,10method: "eth_getLogs",11params: [{"address":"0xB949b4E3945628650862a29Abef3291F2eD52471"}]12}1314request = Net::HTTP::Post.new(uri)15request["Content-Type"] = "application/json"16request.body = JSON.generate(payload)1718response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|19http.request(request)20end2122puts response.body
Response
1{2"jsonrpc": "2.0",3"id": 1,4"result": []5}
1{2"jsonrpc": "2.0",3"id": 1,4"result": []5}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free