eth_getLogs
Returns an array of all logs matching the specified filter.
Ethereum specification · All supported methods
Parameters
Parameters are positional, in the order below.
| Parameter | Type | Required | Description |
|---|---|---|---|
Filter | Filter object | Yes | See the linked specification for field encoding. |
Filter fields
| Field | Meaning |
|---|---|
fromBlock, toBlock | Inclusive hexadecimal block numbers or supported block tags |
address | One contract address or an array of addresses; omit to match all addresses |
topics | Ordered topic filters; null matches any value at a position, and an array matches any listed topic at that position |
blockHash | Restricts the query to one block; cannot be combined with fromBlock or toBlock |
Return value
An array of matching log objects. An empty array means the completed query found no matching logs.
Each returned item includes these fields:
| Field | Type | Description |
|---|---|---|
removed | Boolean | Whether the log was removed following a chain reorganization. |
logIndex | Hexadecimal quantity | Position of the log within its block. |
transactionIndex | Hexadecimal quantity | Position of the transaction within its block. |
transactionHash | 32-byte hash | Hash of the transaction. |
blockHash | 32-byte hash | Hash of the containing block; null for a pending transaction. |
blockNumber | Hexadecimal quantity | Number of the containing block; null for a pending transaction. |
blockTimestamp | Hexadecimal quantity | Containing block’s timestamp, where returned by the network. |
address | 20-byte address | Address of the emitting contract or queried account. |
data | Hexadecimal bytes | Unindexed event data as hexadecimal bytes. |
topics | Array of 32-byte topics | Indexed event topics as an array of 32-byte values. |
Example
Replace <gateway-url> with your gateway base URL and <service-url> with the chain’s service path, such as service/ethereum.
sh
curl -X POST "<gateway-url>/<service-url>" \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[{"fromBlock":"0x137d3c2","toBlock":"0x137d3c3","address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","topics":[]}]}'Illustrative response; values depend on the selected network and request:
json
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x137d3c2",
"blockTimestamp": "0x11",
"blockHash": "0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5",
"transactionHash": "0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d",
"transactionIndex": "0x0",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"data": "0x0000000000000000000000000000000000000000000000000000000000000004",
"topics": [
"0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"
]
}
]
}Direct behavior
Requests for older chain data are automatically routed to providers with full chain history. This covers blocks, transactions, receipts, and logs independently of historical account state.
Requests using latest follow Direct’s reference-block rules. The selected reference is preserved during recovery; separate requests can see a newer reference.
Limits
A range can contain up to 10,000 blocks, including both endpoints. Blocks 100 through 10,099 are within the limit; a range ending at 10,100 exceeds it.
Smaller upstream ranges are handled by the provider’s Direct client: it splits the query and combines the results in block, transaction, and log order. This remains one billable consumer request.
The result must be complete. If any part fails or a reorganization prevents consistent assembly, the request fails rather than returning partial logs. Narrow the range or filters when the response is too large. An error is not an empty log result.
For providers
Support the required recent chain-history service. Advertise full chain history only when all included method families and lookup indexes work back to genesis.
Native support for the public 10,000-block range is recommended. A smaller upstream range is acceptable only if the provider’s client adapts it into a complete result under the public limits. See upstream log adaptation.
See provider qualification for checks and continued eligibility.