> For the complete documentation index, see [llms.txt](https://docs.validationcloud.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.validationcloud.io/v1/rayls/trace-api/trace_filter.md).

# trace\_filter

Returns traces matching given filter.

This method will use `80` [Compute Units](/v1/about/billing.md).

***

## **Parameters**

`object` - object - The filter object

* `fromBlock` - string - The starting block number for the filter in hexadecimal format
* `toBlock` - string - The ending block number for the filter in hexadecimal format
* `fromAddress` - array - An array of sender addresses to filter by
* `toAddress` - array - An array of receiver addresses to filter by
* `after` - integer - The offset trace number for pagination
* `count` - integer - The number of traces to display in a batch

## **Returns**

`result` - array - An array of trace objects that match the given filter

* `action` - object - The trace action object containing details of the call
  * `from` - string - The address of the sender
  * `callType` - string - The type of method such as call, delegatecall, staticcall
  * `gas` - string - The gas provided by the sender encoded as hexadecimal
  * `input` - string - The data sent along with the transaction
  * `to` - string - The address of the receiver
  * `value` - string - The value sent with this transaction encoded as hexadecimal
* `blockHash` - string - The hash of the block containing this transaction
* `blockNumber` - string - The block number containing this transaction encoded as hexadecimal
* `result` - object - The execution result object of the trace
  * `gasUsed` - string - The amount of gas used by this specific trace
  * `output` - string - The value returned by the call, empty if no RETURN was executed
* `subtraces` - integer - The number of subtraces (internal calls) in this trace
* `traceAddress` - array - The list showing the nested call structure of this trace
* `transactionHash` - string - The hash of the transaction
* `transactionPosition` - integer - The transaction index position within the block
* `type` - string - The type of trace, such as call or create

```bash
// Result
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
      {
        "action": {
          "from": "0x786d1ecc7ad626f48d6d95ccb2c0500e52e4a15b",
          "callType": "call",
          "gas": "0x168ef8",
          "input": "0xa9059cbb0000000000000000000000009406c483929bac16a41efae8665d8dab68c33eea0000000000000000000000000000000000000000000000000000000002fa2d30",
          "to": "0x20c0000000000000000000000000000000000000",
          "value": "0x0"
        },
        "blockHash": "0xe1dd033a33e1b2be07a6c3f5256b177b0e09f2d81f8f306eb0a3bb19203d47c2",
        "blockNumber": 8148608,
        "result": {
          "gasUsed": "0x7cf1e",
          "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
        },
        "subtraces": 0,
        "traceAddress": [],
        "transactionHash": "0x9c5c434a92a5efa222d510a77e35d0e0b02b607cf31195dcb80c536271060ebd",
        "transactionPosition": 0,
        "type": "call"
      },
      {
        "action": {
          "from": "0xe7667c20ef0d18721ea91f327d7cbb3fe83b66fc",
          "gas": "0x127e754",
          "init": "0x608060405260405162001480...",
          "value": "0x0",
          "creationMethod": "create"
        },
        "blockHash": "0xe1dd033a33e1b2be07a6c3f5256b177b0e09f2d81f8f306eb0a3bb19203d47c2",
        "blockNumber": 8148608,
        "result": {
          "address": "0x27b1bb23c768bac9e08384e3135c4ccc7fbc92ec",
          "code": "0x60806040526004361061009f...",
          "gasUsed": "0x636c29"
        },
        "subtraces": 0,
        "traceAddress": [],
        "transactionHash": "0x9e2eea4b46aa76ed8c30a57d9bdbc68a16becba529f0d665788e748476db0dad",
        "transactionPosition": 1,
        "type": "create"
      }
    ]
  }
```

{% tabs %}
{% tab title="mainnet" %}

```bash
curl https://mainnet.rayls.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"trace_filter","params":[{"fromBlock":"0x7c5680","toBlock":"0x7c5682"}],"id":1}'
    
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.validationcloud.io/v1/rayls/trace-api/trace_filter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
