Skip to main content

kaia_getLogs

POST

Retrieves logs matching the specified filter criteria. Query directly with filter conditions in the request without creating a separate filter and querying by filter ID.

🚧 Is the response taking a long time? Response time may vary based on block range!

Specifying a wide block range or including blocks with many events may cause response delays or timeouts.

For faster responses, consider the following recommendations:

- Keep the fromBlock ~ toBlock range to 1000 blocks or fewer.

- When using latest for blockTag, the exact block number may not be known internally, which can increase response time.

In that case, query the latest block number with kaia_blockNumber first, then specify it explicitly.
param[0]
logObjectobjectrequired
Object for filtering logs.
fromBlockstring
Use one of block number or block tag to specify the block.
  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
Block number represents the sequence order of a block. It is expressed as a hexadecimal string.
toBlockstring
Use one of block number or block tag to specify the block.
  • Block number: Hexadecimal string (e.g. "0x1")
  • Block tag: Enum string (e.g. "latest", "earliest", "pending")
    • earliest: The oldest available block on the chain.
    • finalized: A recently finalized block that can no longer be changed. Primarily used in proof-of-stake (PoS) blockchains.
    • safe: A recent block considered safe by the network (immune to reorgs).
    • latest: The most recent block on the chain (may be subject to reorgs).
    • pending: The next block to be mined, including pending transactions in the mempool.
Block number represents the sequence order of a block. It is expressed as a hexadecimal string.
addressarray
Enter addresses to filter as an array.
topicsarray
Topics is an array of topics for filtering transaction logs. Each topic is expressed as a 32-byte hexadecimal string.
Responses
addressstring
The address of the contract that emitted this log
topicsarray
Array of event signature hash and indexed parameters (up to 4 entries)
datastring
Non-indexed event parameter data (hex encoded)
blockNumberstring
Block number containing this log (hex)
transactionHashstring
Hash of the transaction that created this log
transactionIndexstring
Transaction position index within the block (hex)
blockHashstring
Hash of the block containing this log
logIndexstring
Log position index within the block (hex)
removedboolean
True if the log was removed due to a chain reorganization
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://kaia-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "kaia_getLogs",
"params": [
{
"fromBlock": "0x12C1A00",
"toBlock": "0x12C1A00",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
]
}
]
}'