Logs
Get Event Logs by Address
Returns the event logs from an address, with optional filtering by block range.
https://api-opbnb.bscscan.com/api
?module=logs
&action=getLogs
&address=0xcbc14e02f03a19d275ef62f05e5deb963859462c
&fromBlock=8648196
&toBlock=8650196
&page=1
&offset=1000
&apikey=YourApiKeyToken
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0xcbc14e02f03a19d275ef62f05e5deb963859462c",
"topics": [
"0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"
],
"data": "0x0000000000000000000000000000000000000000000000057eabe70f4c5a4b8d000000000000000000000000000000000000000000000541b58a2375f67da8b6",
"blockNumber": "0x83f8ae",
"blockHash": "0x556d2d818bd24b9b5108afb2226593d5890f2e1a7b4160c685015e0b7074fa1d",
"timeStamp": "0x655a15a9",
"gasPrice": "0xf4240",
"gasUsed": "0x37fa0",
"logIndex": "0x3",
"transactionHash": "0x80e521a75b6fbb4e1d1ca98fcaf5c142c0a7b41ac5ec0f61a07ed89f97b27621",
"transactionIndex": "0x1"
},
{
"address": "0xcbc14e02f03a19d275ef62f05e5deb963859462c",
"topics": [
"0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822",
"0x0000000000000000000000001dd369d86229877bbc318876232842a651d7fae2",
"0x000000000000000000000000f552c23c30f9b91c5da1f8bed91907417d2faa78"
],
"data": "0x0000000000000000000000000000000000000000000000000061e3430c4f09dc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005d63d27f65ad4c57",
"blockNumber": "0x83f8ae",
"blockHash": "0x556d2d818bd24b9b5108afb2226593d5890f2e1a7b4160c685015e0b7074fa1d",
"timeStamp": "0x655a15a9",
"gasPrice": "0xf4240",
"gasUsed": "0x37fa0",
"logIndex": "0x4",
"transactionHash": "0x80e521a75b6fbb4e1d1ca98fcaf5c142c0a7b41ac5ec0f61a07ed89f97b27621",
"transactionIndex": "0x1"
}
]
}
Get Event Logs by Topics
Returns the events log in a block range, filtered by topics.
https://api-opbnb.bscscan.com/api
?module=logs
&action=getLogs
&fromBlock=8658190
&toBlock=8658196
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&topic0_1_opr=and
&topic1=0x0000000000000000000000000000000000000000000000000000000000000000
&page=1
&offset=1000
&apikey=YourApiKeyToken
Usage:
For a single topic, specify the topic number such as
topic0
,topic1
,topic2
,topic3
For multiple topics, specify the topic numbers and topic operator either
and
oror
such as below topic0_1_opr (and|or between topic0 & topic1), topic1_2_opr (and|or between topic1 & topic2) topic2_3_opr (and|or between topic2 & topic3), topic0_2_opr (and|or between topic0 & topic2) topic0_3_opr (and|or between topic0 & topic3), topic1_3_opr (and|or between topic1 & topic3)
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0x8c417ca6c14f770903d716b8acda130d33e9c681",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000002d0b28c7f55c50b470b13f8602cd67d8aa7e8e34",
"0x000000000000000000000000000000000000000000000000000000000001df3e"
],
"data": "0x",
"blockNumber": "0x841d0e",
"blockHash": "0x8fe0efcc500bec18164a74b2c06dba99461b42d320e36c919f48be3e6b47dbd6",
"timeStamp": "0x655a3a09",
"gasPrice": "0x186a0",
"gasUsed": "0x6c837",
"logIndex": "0xe",
"transactionHash": "0xb4be20cbd675b60449f0a42ad66d19755b00bee4113443c1e3add92cb5614c1c",
"transactionIndex": "0x1"
}
]
}
Get Event Logs by Address filtered by Topics
Returns the event logs from an address, filtered by topics and block range.
https://api-opbnb.bscscan.com/api
?module=logs
&action=getLogs
&fromBlock=6222123
&toBlock=6222123
&address=0xe90feAEff7B2Ca89b967FA08934C0045b5Fd4c1e
&topic0=0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62
&topic0_1_opr=and
&topic1=0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace
&page=1
&offset=1000
&apikey=YourApiKeyToken
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0xe90feaeff7b2ca89b967fa08934c0045b5fd4c1e",
"topics": [
"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"0x000000000000000000000000330225a869df4ac4a9e1cd8ceb1b0be38097c417",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"blockNumber": "0x5ef12b",
"blockHash": "0x0d33e69a4d07f91f6b4f32a0190553ad24729d51e5d7214682a8ddced1a71e7a",
"timeStamp": "0x65350e26",
"gasPrice": "0x2718",
"gasUsed": "0x284f7",
"logIndex": "0x6",
"transactionHash": "0x637a307f4dfcb52376c6bdd8b3cd0562f2d7801612f71b48f5f0e82670a49d0a",
"transactionIndex": "0x3"
},
{
"address": "0xe90feaeff7b2ca89b967fa08934c0045b5fd4c1e",
"topics": [
"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"0x000000000000000000000000e4329c225414b0d792909f6a8b3e673e29916d79",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"blockNumber": "0x5ef12b",
"blockHash": "0x0d33e69a4d07f91f6b4f32a0190553ad24729d51e5d7214682a8ddced1a71e7a",
"timeStamp": "0x65350e26",
"gasPrice": "0x2718",
"gasUsed": "0x284f7",
"logIndex": "0xd",
"transactionHash": "0x99aed6d14c72d14934665f11a8e08dd678f739be9f9ce63a1320080ffcaa0cbe",
"transactionIndex": "0x6"
}
]
}
Last updated