# Linea eth_getLogs

> Returns filtered logs on Linea.

# `eth_getLogs`

<Description />

## Parameters

A filter object containing the following:

- `address`: [_optional_] Contract address (20 bytes) or a list of addresses from which logs should originate.
- `fromBlock`: (string) _[optional, default is "latest"]_ A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `toBlock`: (string) _[optional, default is "latest"]_ A hexadecimal block number, or one of the tags `latest`, `earliest`, `pending`, or `finalized`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
  :::warning
  `safe` isn't supported. Use `finalized` instead.
  Learn more about [Linea's layer 2 finalization](https://docs.linea.build/developers/guides/finalized-block).
  :::
- `topics`: _[optional]_ Array of 32 bytes DATA topics. Topics are order-dependent.
- `blockhash`: _[optional]_ Restricts the logs returned to the single block referenced in the 32-byte hash `blockHash`. Using `blockHash` is equivalent to setting `fromBlock` and `toBlock` to the block number referenced in the `blockHash`. If `blockHash` is present in the filter criteria, then neither `fromBlock` nor `toBlock` are allowed.

## Returns

<Returns />

## Example

<Example />

### Request

<Tabs>
  <TabItem value="curl">

```bash
curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}],"id":1}'
```

  </TabItem>
  <TabItem value="WSS">

```bash
wscat -c wss://linea-mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash": "0x7c5a35e9cb3e8ae0e221ab470abae9d446c3a5626ce6689fc777dcffcab52c70", "topics":["0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"]}],"id":1}'
```

  </TabItem>
</Tabs>

### Response

<Response />
