Get Event Logs by Address#
Query the event logs emitted by a given contract address, returned page by page using a cursor. This endpoint supports EVM-compatible chains only.
Supported chains: see Get Event Log API Supported Chains (apiName: by-address).
Request URL#
GET
https://web3.okx.com/api/v6/explorer/log/by-addressRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainIndex | String | Yes | Unique identifier of the chain, e.g., 1 for ETH and 0 for BTC. See Get Event Log API Supported Chains for supported values. |
| address | String | Yes | Contract address. |
| cursor | String | No | Cursor returned by the previous response. Omit it or pass an empty string to start from the first page. |
| limit | String | No | Number of entries per page. Default is 100, maximum is 1000. |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| limit | String | Maximum number of entries on this page. |
| cursor | String | Cursor for the next page; an empty string means no more pages. Pass it back as-is; clients should not parse or construct it. |
| logList | Array | Event log list. |
| > height | String | Block height. |
| > address | String | Contract address that emitted the event log. |
| > topics | Array | Topic list, with String elements. |
| > data | String | The event log's data field, as a hexadecimal string. |
| > methodId | String | methodId, identifying the method that triggered the log. |
| > blockHash | String | Block hash. |
| > transactionTime | String | Transaction time, as a Unix timestamp in milliseconds. |
| > logIndex | String | Log index. |
| > txId | String | Transaction hash. |
Request Example#
shell
curl --location --request GET 'https://web3.okx.com/api/v6/explorer/log/by-address?chainIndex=1&address=0xdac17f958d2ee523a2206206994597c13d831ec7&limit=100' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
Response Example#
json
{
"code": "0",
"msg": "",
"data": [
{
"limit": "100",
"cursor": "100",
"logList": [
{
"height": "21284102",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"topics": [
"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"0x0000000000000000000000001b7baa734c00298b9429b518d621753bb0f6eff2",
"0x00000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc45"
],
"data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"methodId": "0x095ea7b3",
"blockHash": "0x5c7e9a2d4f6b8c0e1a1f3c5a0d9e7b2c4a6d8f0b1c3e5a7d9f2b4c6e8a0d1f3b",
"transactionTime": "1733198723000",
"logIndex": "42",
"txId": "0xb8e6c4a1f9d3b5e7c0a2d4f6b8e1c3a5d7f9b2e4c6a8d0f37d4b1e9c3a5f70d2"
}
]
}
]
}
