> For the complete documentation index, see [llms.txt](/llms.txt).

# `trace_filter`

Returns traces matching the specified filter. The block range is limited to 100 blocks per query (the difference between `fromBlock` and `toBlock`). This method uses [300 credits](/services/get-started/pricing/) from your daily balance.

## Parameters[​](#parameters "Direct link to Parameters")

- `filter object` _[Required]_ with the following keys and their values:  
  - `fromBlock`: _[optional]_ Trace starts at this block.
  - `toBlock`: _[optional]_ Trace stops at this block.
  - `fromAddress`: _[optional]_ Include only traces sent from this address.
  - `toAddress`: _[optional]_ Include only traces with this destination address.
  - `after`: _[optional]_ The offset trace number.
  - `count`: _[optional]_ Number of traces to display in a batch.

## Returns[​](#returns "Direct link to Returns")

A [trace](/services/reference/ethereum/json-rpc-methods/trace-methods/#trace) list that matches the supplied filter.

## Example[​](#example "Direct link to Example")

Replace `<YOUR-API-KEY>` with an API key from your [Infura dashboard](https://app.infura.io/).

### Request[​](#request "Direct link to Request")

- curl
- WSS

```
curl https://mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "trace_filter", "params": [{"fromBlock": "0x1", "toBlock": "0x21", "after": 2, "count": 2, "fromAddress": ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"]}], "id": 415}'

```

```
wscat -c wss://mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "trace_filter", "params": [{"fromBlock": "0x1", "toBlock": "0x21", "after": 2, "count": 2, "fromAddress": ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"]}], "id": 415}'

```

### Response[​](#response "Direct link to Response")

- JSON

```
{
  "jsonrpc": "2.0",
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
        "gas": "0xffad82",
        "input": "0x0000000000000000000000000000000000000999",
        "to": "0x0020000000000000000000000000000000000000",
        "value": "0x0"
      },
      "blockHash": "0xcd5d9c7acdcbd3fb4b24a39e05a38e32235751bb0c9e4f1aa16dc598a2c2a9e4",
      "blockNumber": 6,
      "result": {
        "gasUsed": "0x7536",
        "output": "0x"
      },
      "subtraces": 1,
      "traceAddress": [],
      "transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e",
      "transactionPosition": 0,
      "type": "call"
    },
    {
      "action": {
        "callType": "call",
        "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
        "gas": "0xffad52",
        "input": "0xf000000000000000000000000000000000000000000000000000000000000001",
        "to": "0x0030000000000000000000000000000000000000",
        "value": "0x0"
      },
      "blockHash": "0xeed85fe57db751442c826cfe4fdf43b10a5c2bc8b6fd3a8ccced48eb3fb35885",
      "blockNumber": 7,
      "result": {
        "gasUsed": "0x1b",
        "output": "0xf000000000000000000000000000000000000000000000000000000000000002"
      },
      "subtraces": 0,
      "traceAddress": [],
      "transactionHash": "0x47f4d445ea1812cb1ddd3464ab23d2bfc6ed408a8a9db1c497f94e8e06e85286",
      "transactionPosition": 0,
      "type": "call"
    }
  ],
  "id": 415
}

```
