> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_newFilter | Tempo

> Tempo API method that creates a new filter for logs matching specified criteria. The filter can be polled with eth_getFilterChanges.

Tempo API method that creates a new filter for logs matching specified criteria. The filter can be polled with `eth_getFilterChanges`.

## Parameters

* `filterObject` — the filter object:
  * `fromBlock` — (optional) block number (hex) or tag to start from
  * `toBlock` — (optional) block number (hex) or tag to end at
  * `address` — (optional) contract address or array of addresses
  * `topics` — (optional) array of topic filters

## Response

* `result` — the filter ID

## `eth_newFilter` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const PATHUSD = "0x20c0000000000000000000000000000000000000";

  const createFilter = async () => {
      const filterId = await provider.send("eth_newFilter", [{
        address: PATHUSD,
        fromBlock: "latest",
        toBlock: "latest"
      }]);
      console.log(`Filter ID: ${filterId}`);
    };

  createFilter();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  PATHUSD = "0x20c0000000000000000000000000000000000000"

  filter_id = web3.eth.filter({
      'address': PATHUSD,
      'fromBlock': 'latest'
  })
  print(f"Filter ID: {filter_id.filter_id}")
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "method": "eth_newFilter",
      "params": [{"address": "0x20c0000000000000000000000000000000000000", "fromBlock": "latest"}],
      "id": 1
    }'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/tempo_node_api/filter_handling/eth_newFilter.json POST /
openapi: 3.0.0
info:
  title: eth_newFilter Tempo example
  version: 1.0.0
  description: This is an API example for eth_newFilter for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Filter handling
      summary: eth_newFilter
      operationId: tempo-eth-newFilter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_newFilter
                params:
                  type: array
                  items: {}
                  default:
                    - fromBlock: latest
                      toBlock: latest
                      address: '0x20c0000000000000000000000000000000000000'
                      topics: []
                  description: Filter object
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The filter ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: The filter ID

````