Pre-alphaWork in progress
Skip to content

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.

ParameterTypeRequiredDescription
FilterFilter objectYesSee the linked specification for field encoding.

Filter fields ​

FieldMeaning
fromBlock, toBlockInclusive hexadecimal block numbers or supported block tags
addressOne contract address or an array of addresses; omit to match all addresses
topicsOrdered topic filters; null matches any value at a position, and an array matches any listed topic at that position
blockHashRestricts 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:

FieldTypeDescription
removedBooleanWhether the log was removed following a chain reorganization.
logIndexHexadecimal quantityPosition of the log within its block.
transactionIndexHexadecimal quantityPosition of the transaction within its block.
transactionHash32-byte hashHash of the transaction.
blockHash32-byte hashHash of the containing block; null for a pending transaction.
blockNumberHexadecimal quantityNumber of the containing block; null for a pending transaction.
blockTimestampHexadecimal quantityContaining block’s timestamp, where returned by the network.
address20-byte addressAddress of the emitting contract or queried account.
dataHexadecimal bytesUnindexed event data as hexadecimal bytes.
topicsArray of 32-byte topicsIndexed 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.

Unstoppable Infrastructure.