/streams/rest/v1/streams/test_filter REST Method
Body Parameters
network
string
REQUIRED
The network for this stream. ENUM: "arbitrum-mainnet", "arbitrum-sepolia", "avalanche-fuji", "avalanche-mainnet", "base-mainnet", "base-sepolia", "bera-artio", "bera-bartio", "bitcoin-mainnet", "blast-mainnet", "blast-sepolia", "bnbchain-mainnet", "bnbchain-testnet", "camp-sepolia", "celo-mainnet", "cyber-mainnet", "cyber-sepolia", "ethereum-holesky", "ethereum-mainnet", "ethereum-sepolia", "fantom-mainnet", "fraxtal-mainnet", "gnosis-mainnet", "kaia-mainnet", "kaia-testnet", "imx-mainnet", "imx-testnet", "mantle-mainnet", "mantle-sepolia", "mode-mainnet", "morph-holesky", "nova-mainnet", "optimism-mainnet", "optimism-sepolia", "omni-omega", "polygon-mainnet", "polygon-amoy", "race-mainnet", "race-testnet", "redstone-mainnet", "scroll-mainnet", "scroll-testnet", "story-testnet", "tron-mainnet", "xai-mainnet", "xai-sepolia", "zkevm-mainnet", "zksync-mainnet", "zksync-sepolia", "zora-mainnet"
dataset
string
REQUIRED
The dataset for this stream. ENUM: "block", "block_with_receipts", "receipts", "logs", "transactions", "trace_blocks", "debug_traces", "block_with_receipts_debug_trace", "block_with_receipts_trace_block"
filter_function
string<base64>
REQUIRED
JS/ECMAScript compliant filter encoded in base64.
block
string
REQUIRED
The block number to test against.
Returns
result
string
The result of the filter test.
Request
1curl -X POST \2"https://api.quicknode.com/streams/rest/v1/streams/test_filter" \3-H "accept: application/json" \4-H "Content-Type: application/json" \5-H "x-api-key: YOUR_API_KEY" \6-d $'{7"network": "ethereum-mainnet",8"dataset": "block",9"filter_function": "ZnVuY3Rpb24gbWFpbihkYXRhKSB7CiAgICB2YXIgbnVtYmVyRGVjaW1hbCA9IHBhcnNlSW50KGRhdGEuc3RyZWFtRGF0YS5udW1iZXIsIDE2KTsKICAgIHZhciBmaWx0ZXJlZERhdGEgPSB7CiAgICAgICAgaGFzaDogZGF0YS5zdHJlYW1EYXRhLmhhc2gsCiAgICAgICAgbnVtYmVyOiBudW1iZXJEZWNpbWFsCiAgICB9OwogICAgcmV0dXJuIGZpbHRlcmVkRGF0YTsKfQ==",10"block": "17811625"11}'12
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free