> For the complete documentation index, see [llms.txt](https://docs.rpcfast.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rpcfast.com/rpc-fast-saas-evm/ethereum-api/eth_getlogs-ethereum.md).

# eth\_getLogs - Ethereum

eth\_getLogs on Ethereum: returns the event logs that match a filter. Parameters, response and request example for the RPC Fast endpoint.

Returns the event logs that match a filter.

{% hint style="info" %}
Keep block ranges small and filter by `address` or `topics`: a wide range over a busy chain takes long and costs the same per call.
{% endhint %}

## Parameters

1. `filter` (object) — Log filter
   * `fromBlock` (string) — Optional. First block, block number as hex, or a tag: `latest`, `earliest`, `pending`, `safe`, `finalized`
   * `toBlock` (string) — Optional. Last block, same format as `fromBlock`
   * `address` (address | array) — Optional. Contract address or list of addresses
   * `topics` (array) — Optional. Topic filters by position; `null` matches anything, a nested array matches any of its values
   * `blockHash` (hash) — Optional. Restricts the result to one block; cannot be combined with `fromBlock`/`toBlock`

## Returns

Array of logs: `address`, `topics`, `data`, `blockNumber`, `blockHash`, `transactionHash`, `transactionIndex`, `logIndex` and `removed`.

## Example

#### Request

```bash
curl https://eth-mainnet.rpcfast.com/?api_key=<API_KEY> \
  -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getLogs","params":[{"fromBlock":"0x192a337","toBlock":"0x192a337","address":"0xdac17f238db9863dae526eb0dc935e7cf9fcec54"}]}'
```

#### Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "address": "0xdac17f238db9863dae526eb0dc935e7cf9fcec54",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x000000000000000000000000235fd1f0b4b0817f9f974a0ee80cbc1fd7b38a17",
        "0x000000000000000000000000d4ce9489d9d5e3e8e755e93c22d1a296bf04d748"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000000000000000002",
      "blockHash": "0xcb340ea929c555563cdb3c6db683fc96c6d015d0119c691c40f980b8b61c3eff",
      "blockNumber": "0x192a337",
      "blockTimestamp": "0x6af38ef3",
      "transactionHash": "0x20f6cbee4067a1b977016915b689e742f665158de4b631341a6877dac372ca14",
      "transactionIndex": "0x0",
      "logIndex": "0x0",
      "removed": false
    },
    {
      "address": "0xdac17f238db9863dae526eb0dc935e7cf9fcec54",
      "topics": [
        "0x69d21b294c0b932db9bb0dc81144c65ac23a4c078f00589443bb03baa63e3c96",
        "0x0000000000000000000000000000000000000000000000000000000000000009",
        "0x000000000000000000000000235fd1f0b4b0817f9f974a0ee80cbc1fd7b38a17",
        "… 1 more"
      ],
      "data": "0x0000000000000000000000000000000000000000000000000000000000000002",
      "blockHash": "0xcb340ea929c555563cdb3c6db683fc96c6d015d0119c691c40f980b8b61c3eff",
      "blockNumber": "0x192a337",
      "blockTimestamp": "0x6af38ef3",
      "transactionHash": "0x20f6cbee4067a1b977016915b689e742f665158de4b631341a6877dac372ca14",
      "transactionIndex": "0x0",
      "logIndex": "0x1",
      "removed": false
    },
    {
      "address": "0xdac17f238db9863dae526eb0dc935e7cf9fcec54",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
        "0x000000000000000000000000235fd1f0b4b0817f9f974a0ee80cbc1fd7b38a17",
        "0x000000000000000000000000d4ce9489d9d5e3e8e755e93c22d1a296bf04d748"
      ],
      "data": "0x00000000000000000000000000000000000000000000000000000000004b17e8",
      "blockHash": "0xcb340ea929c555563cdb3c6db683fc96c6d015d0119c691c40f980b8b61c3eff",
      "blockNumber": "0x192a337",
      "blockTimestamp": "0x6af38ef3",
      "transactionHash": "0x20f6cbee4067a1b977016915b689e742f665158de4b631341a6877dac372ca14",
      "transactionIndex": "0x0",
      "logIndex": "0x2",
      "removed": false
    },
    "… 15 more"
  ]
}
```

See [Compute Units](https://docs.rpcfast.com/rpc-fast-saas-evm/compute-units-cus.md) for the price of this method on Ethereum.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rpcfast.com/rpc-fast-saas-evm/ethereum-api/eth_getlogs-ethereum.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
