# eth_newFilter - Ethereum Creates a filter object, based on filter options, to notify when the state changes (logs). Unlike [eth\_newBlockFilter](https://unifra.readme.io/reference/eth_newblockfilter) which notifies you of all **new** blocks, you can pass in filter options to track new logs matching the topics specified.\ To check if the state has changed, call [eth\_getFilterChanges](https://unifra.readme.io/reference/eth_getfilterchanges) > **A note on specifying topic filters:**\ > Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic filters: > > * \[] “anything” > * [A] “A in first position (and anything after)” > * [null, B] “anything in first position AND B in second position (and anything after)” > * [A, B] “A in first position AND B in second position (and anything after)” > * \[[A, B], [A, B]] “(A OR B) in first position AND (A OR B) in second position (and anything after)” # Parameters * Object - The filter options: * fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. * toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. * address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. * topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with “or” options. ```json params: [ { fromBlock: "0x1", toBlock: "0x2", address: "0x8888f1f195afa192cfee860698584c030f4c9db1", topics: [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, [ "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc", ], ], }, ]; ``` *** # Returns QUANTITY - A filter id. *** # Example ## Request ```curl curl https://eth-mainnet.unifra.io/v1/your-api-key \ -X POST \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock": "0x1","toBlock": "0x2","address": "0x8888f1f195afa192cfee860698584c030f4c9db1","topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}],"id":0}' ``` ```Text Postman URL: https://eth-mainnet.unifra.io/v1/your-api-key RequestType: POST Body: { "jsonrpc":"2.0", "method":"eth_newFilter", "params":[{"fromBlock": "0x1","toBlock": "0x2","address": "0x8888f1f195afa192cfee860698584c030f4c9db1","topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id":0 } ``` ## Result ```json { "jsonrpc": "2.0", "id": 0, "result": "0xdcc9a819f80efa9e1d215a9d41b2d22e" } ``` > 🚧 The below parameter inputs do not work, please reference the section above instead. # OpenAPI definition ```json { "openapi": "3.1.0", "info": { "title": "ethereum-api", "version": "1.0" }, "servers": [ { "url": "https://eth-mainnet.unifra.io/v1" } ], "security": [ {} ], "paths": { "/{your-api-key}": { "post": { "summary": "web3_sha3 - Ethereum", "description": "Returns Keccak-256 (not the standardized SHA3-256) of the given data.", "operationId": "web3_sha3", "parameters": [ { "name": "your-api-key", "in": "path", "schema": { "type": "string" }, "required": true } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "jsonrpc": { "type": "string", "default": "2.0" }, "method": { "type": "string", "default": "web3_sha3" }, "params": { "type": "array", "items": { "type": "string" } }, "id": { "type": "integer", "default": 0, "format": "int32" } } } } } }, "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{}" } }, "schema": { "type": "object", "properties": {} } } } }, "400": { "description": "400", "content": { "application/json": { "examples": { "Result": { "value": "{}" } }, "schema": { "type": "object", "properties": {} } } } } }, "deprecated": false } } }, "x-readme": { "headers": [], "explorer-enabled": true, "proxy-enabled": true }, "x-readme-fauxas": true } ```