> ## 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_newBlockFilter | Tempo

> Tempo API method that creates a filter for new block notifications. The filter can be polled with eth_getFilterChanges to get new block hashes.

Tempo API method that creates a filter for new block notifications. The filter can be polled with `eth_getFilterChanges` to get new block hashes.

With Tempo's \~0.5 second block times, this filter will receive frequent updates.

## Parameters

* `none`

## Response

* `result` — the filter ID

## `eth_newBlockFilter` 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 createBlockFilter = async () => {
      const filterId = await provider.send("eth_newBlockFilter", []);
      console.log(`Filter ID: ${filterId}`);

      // Poll for new blocks
      const newBlocks = await provider.send("eth_getFilterChanges", [filterId]);
      console.log(`New block hashes: ${newBlocks}`);
    };

  createBlockFilter();
  ```

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

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

  block_filter = web3.eth.filter('latest')
  print(f"Filter ID: {block_filter.filter_id}")

  # Poll for new blocks
  new_blocks = block_filter.get_new_entries()
  print(f"New blocks: {new_blocks}")
  ```

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


## OpenAPI

````yaml openapi/tempo_node_api/filter_handling/eth_newBlockFilter.json POST /
openapi: 3.0.0
info:
  title: eth_newBlockFilter Tempo example
  version: 1.0.0
  description: This is an API example for eth_newBlockFilter for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Filter handling
      summary: eth_newBlockFilter
      operationId: tempo-eth-newBlockFilter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_newBlockFilter
                params:
                  type: array
                  items: {}
                  default: []
                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 for new block notifications

````