{"id":3886,"date":"2026-10-09T10:11:54","date_gmt":"2026-10-09T10:11:54","guid":{"rendered":"https:\/\/nownodes.io\/blog\/?p=3886"},"modified":"2026-10-09T10:11:55","modified_gmt":"2026-10-09T10:11:55","slug":"how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket","status":"publish","type":"post","link":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/","title":{"rendered":"How to Stream and Filter Pending Transactions on Ethereum over WebSocket"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You stream pending transactions by opening a WebSocket subscription to <code>newPendingTransactions<\/code>, then resolving each hash the socket pushes into a full transaction object. You filter that stream in one of two places: in your own code after decoding each transaction, or on the provider&#8217;s side with a subscription that only sends you matches.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The default stream is a firehose. On a busy chain, thousands of unconfirmed transactions flow through every minute, and almost none of them matter to your app. The skill worth learning is not just opening the socket \u2014 most tutorials stop there \u2014 but cutting the stream down to the handful of transactions you actually care about. This guide walks through the subscription, the code to consume it in a current library, and three ways to filter it.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-an-unconfirmed-transaction-on-ethereum\">What Is an Unconfirmed Transaction on Ethereum?<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-56-1024x683.png\" alt=\"\" class=\"wp-image-3887\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-56-1024x683.png 1024w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-56-300x200.png 300w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-56-768x512.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-56.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">An unconfirmed transaction is one that has been broadcast to the network but not yet included in a block. It sits in the mempool \u2014 the memory pool each node keeps of transactions it has seen and validated but not yet mined.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two details shape everything that follows. First, the mempool is node-local: each node holds its own view, so what one endpoint streams can differ slightly from another at the same instant. Second, a transaction in this state is temporary. It gets mined, replaced by a higher-fee transaction with the same nonce, or dropped when the pool fills up. For the mechanics of the pool itself \u2014 the <code>txpool<\/code> methods, private relays, why public endpoints hide most of it \u2014 see <a href=\"https:\/\/nownodes.io\/blog\/how-to-access-ethereum-mempool\/\">how to access the Ethereum mempool<\/a>. This guide stays on the streaming side.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-subscribe-instead-of-polling-the-chain\">Why Subscribe Instead of Polling the Chain?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Because polling for new transactions is slow, wasteful, or both. Polling means your app repeatedly asks an endpoint &#8220;anything new?&#8221; \u2014 and the mempool changes far too fast for that to keep up without burning requests.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pace makes the point. On Ethereum mainnet, new pending-transaction events land roughly every 700\u2013800 milliseconds, according to <a href=\"https:\/\/docs.infura.io\/concepts\/websockets\/\" rel=\"nofollow noopener noreferrer\">Infura&#8217;s WebSocket documentation<\/a>. A polling loop either checks that often and spends a request on each cycle, most returning nothing new, or checks less often and misses transactions between cycles. A WebSocket subscription inverts the model: you open one connection, and the node pushes each transaction the moment it arrives. No wasted calls, no fixed lag.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"who-watches-the-mempool-stream-and-for-what\">Who Watches the Mempool Stream, and for What?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The groups that consume this feed want very different slices of it, which is exactly why filtering matters.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Trading and liquidation bots<\/strong> watch for calls to a specific DEX router or lending contract, ignoring everything else.<\/li>\n\n\n\n<li><strong>Wallets and dApps<\/strong> track one user&#8217;s address to show an incoming payment before it confirms.<\/li>\n\n\n\n<li><strong>Monitoring backends<\/strong> alert on activity against a protocol&#8217;s own contracts \u2014 an unusual sender, a known-risky method \u2014 in the seconds before it lands.<\/li>\n\n\n\n<li><strong>Analytics tools<\/strong> sample the whole stream to measure gas pressure and fee trends.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Only the last group wants the raw firehose. The rest want a filter.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-open-the-subscription\">How to Open the Subscription<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The subscription itself is one JSON-RPC message. You send <code>eth_subscribe<\/code> with <code>newPendingTransactions<\/code> as the parameter, over a WebSocket (<code>wss:\/\/<\/code>) connection rather than HTTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_subscribe\",\"params\":&#91;\"newPendingTransactions\"]}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">By default this streams transaction <em>hashes<\/em> \u2014 a 32-byte identifier, not the transaction itself. To do anything useful with a match, you follow up with <code>eth_getTransactionByHash<\/code> to pull the full object. The <a href=\"https:\/\/ethereum.org\/en\/developers\/tutorials\/using-websockets\/\" rel=\"nofollow noopener noreferrer\">ethereum.org WebSocket tutorial<\/a> documents this subscribe-then-resolve pattern across the standard feeds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One client-level shortcut is worth knowing. Geth accepts an optional second boolean on this subscription: pass <code>true<\/code> and it streams full transaction bodies instead of hashes, skipping the follow-up call, per the <a href=\"https:\/\/geth.ethereum.org\/docs\/interacting-with-geth\/rpc\/pubsub\" rel=\"nofollow noopener noreferrer\">Geth pub\/sub documentation<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_subscribe\",\"params\":&#91;\"newPendingTransactions\", true]}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Support for that second argument depends on the client and the endpoint exposing it, so test it against your specific provider before relying on it. The hashes-only form is the safe baseline.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"streaming-it-with-a-library-ethers-v6-and-viem\">Streaming It With a Library: ethers v6 and viem<\/h2>\n\n\n<p class=\"wp-block-paragraph\">In practice you rarely hand-roll the socket. A library manages the connection, the subscription, and the JSON framing for you. Two libraries dominate current Ethereum development, and both have moved on from the examples you&#8217;ll find in older guides.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A note on tooling before the code: if you&#8217;re reaching for web3.js, reconsider. ChainSafe, its maintainer, has <a href=\"https:\/\/blog.chainsafe.io\/web3-js-sunset\/\" rel=\"nofollow noopener noreferrer\">announced that web3.js is being sunset<\/a> and is steering developers elsewhere. New work belongs on ethers or viem.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"ethersjs-v6\">ethers.js (v6)<\/h3>\n\n\n<p class=\"wp-block-paragraph\">The current major version is ethers v6, and its syntax differs from the v5 code in most tutorials \u2014 the provider is imported differently and values come back as native <code>BigInt<\/code>. The event name is still <code>\"pending\"<\/code>, and it hands you a hash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">js<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { WebSocketProvider } from \"ethers\";\n\nconst provider = new WebSocketProvider(\"wss:\/\/your-endpoint\");\n\nprovider.on(\"pending\", async (txHash) =&gt; {\n  const tx = await provider.getTransaction(txHash);\n  if (!tx) return; \/\/ mined or dropped before we could fetch it\n  console.log(tx.hash, tx.to, tx.value.toString());\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>if (!tx) return<\/code> line is not optional in production. A hash can vanish from the pool between the moment you receive it and the moment you query it, and <code>getTransaction<\/code> then returns <code>null<\/code>.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"viem\">viem<\/h3>\n\n\n<p class=\"wp-block-paragraph\">viem exposes the same feed through <code>watchPendingTransactions<\/code>, which calls your handler with an array of hashes. On a WebSocket transport it uses a real subscription; on an HTTP transport it falls back to polling, as the <a href=\"https:\/\/viem.sh\/docs\/actions\/public\/watchPendingTransactions\" rel=\"nofollow noopener noreferrer\">viem documentation<\/a> describes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ts<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { createPublicClient, webSocket } from \"viem\";\nimport { mainnet } from \"viem\/chains\";\n\nconst client = createPublicClient({\n  chain: mainnet,\n  transport: webSocket(\"wss:\/\/your-endpoint\"),\n});\n\nconst unwatch = client.watchPendingTransactions({\n  onTransactions: async (hashes) =&gt; {\n    for (const hash of hashes) {\n      const tx = await client.getTransaction({ hash });\n      console.log(tx.hash, tx.to, tx.value);\n    }\n  },\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>watchPendingTransactions<\/code> returns an <code>unwatch<\/code> function \u2014 call it to close the subscription cleanly when you&#8217;re done.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both examples point at a <code>wss:\/\/<\/code> URL. That endpoint has to keep a socket open for you around the clock, which is the part that&#8217;s awkward to self-host just to watch a stream. The <a href=\"https:\/\/nownodes.io\/wss\">NOWNodes WebSocket API<\/a> provides this persistent connection on supported networks including Ethereum, so your app can subscribe to pending activity without running an always-on client of its own. The <code>wss:\/\/<\/code> address comes from a standard <a href=\"https:\/\/nownodes.io\/nodes\/ethereum-eth\">Ethereum endpoint<\/a>.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-filter-the-stream-down-to-what-you-care-about\">How to Filter the Stream Down to What You Care About<\/h2>\n\n\n<p class=\"wp-block-paragraph\">This is where a working script becomes a useful one. You have two places to filter, and the right choice depends on how much of the stream you can afford to receive.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"filtering-in-your-own-code\">Filtering in Your Own Code<\/h3>\n\n\n<p class=\"wp-block-paragraph\">The straightforward approach: receive every hash, resolve it, and keep only the transactions that match your rule. Once you hold the full object, you can filter on any field. The most useful four:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Filter on<\/th><th>Field<\/th><th>Example target<\/th><\/tr><\/thead><tbody><tr><td>Who sent it<\/td><td><code>from<\/code><\/td><td>A wallet you monitor<\/td><\/tr><tr><td>Where it&#8217;s going<\/td><td><code>to<\/code><\/td><td>A DEX router or your own contract<\/td><\/tr><tr><td>How much ETH<\/td><td><code>value<\/code><\/td><td>Transfers above a threshold<\/td><\/tr><tr><td>What it calls<\/td><td>first 4 bytes of <code>input<\/code><\/td><td>A specific function<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That last row is the sharp one. The first four bytes of a transaction&#8217;s input data are the <strong>function selector<\/strong> \u2014 a hash of the function signature that identifies which contract method is being called. Matching on it lets you watch for one specific action, like a swap, and ignore every other call to the same contract.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">js<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const UNISWAP_ROUTER = \"0x7a250d5630b4cf539739df2c5dacb4c659f2488d\";\n\nprovider.on(\"pending\", async (txHash) =&gt; {\n  const tx = await provider.getTransaction(txHash);\n  if (!tx || tx.to?.toLowerCase() !== UNISWAP_ROUTER) return;\n\n  const selector = tx.data.slice(0, 10); \/\/ \"0x\" + 4 bytes\n  console.log(\"Router call:\", tx.hash, \"method:\", selector);\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This runs on any standard endpoint and gives you unlimited filtering logic. The cost is bandwidth: you still receive and resolve every transaction on the chain, then discard most of them.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"filtering-on-the-providers-side\">Filtering on the Provider&#8217;s Side<\/h3>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"1024\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-57-683x1024.png\" alt=\"\" class=\"wp-image-3888\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-57-683x1024.png 683w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-57-200x300.png 200w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-57-768x1152.png 768w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/image-57.png 1024w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Some providers let you push the filter upstream, so you only receive matches in the first place. Alchemy&#8217;s enhanced <code>alchemy_pendingTransactions<\/code> subscription accepts <code>fromAddress<\/code>, <code>toAddress<\/code>, and a <code>hashesOnly<\/code> flag, and when <code>hashesOnly<\/code> is <code>false<\/code> it streams the full transaction object directly \u2014 no follow-up call \u2014 according to <a href=\"https:\/\/www.alchemy.com\/docs\/how-to-subscribe-to-transactions-via-websocket-endpoints\" rel=\"nofollow noopener noreferrer\">Alchemy&#8217;s subscription documentation<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"eth_subscribe\",\n \"params\":&#91;\"alchemy_pendingTransactions\",\n   {\"toAddress\":&#91;\"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\"],\n    \"hashesOnly\":false}]}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That example streams only pending transactions headed to the USDC contract, with full objects. For a high-volume target, receiving one in a thousand transactions instead of all of them is a real saving.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The trade-off is portability. <code>newPendingTransactions<\/code> is a standard method that behaves the same across providers; <code>alchemy_pendingTransactions<\/code> is specific to one. Auston Bunsen, co-founder of QuickNode, framed the general risk in an interview with <a href=\"https:\/\/sacra.com\/research\/auston-bunsen-quicknode-infrastructure-multi-chain\/\" rel=\"nofollow noopener noreferrer\">Sacra<\/a>: &#8220;I can go from Alchemy to Infura to QuickNode relatively quickly, unless I&#8217;m using one of their sort of custom APIs.&#8221; A filtered feed built on a vendor-specific method is exactly that kind of custom API \u2014 convenient now, a rewrite later if you switch.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><\/th><th>Client-side filter<\/th><th>Server-side filter<\/th><\/tr><\/thead><tbody><tr><td>Where it runs<\/td><td>Your code, after decoding<\/td><td>The provider, before sending<\/td><\/tr><tr><td>Bandwidth<\/td><td>You receive every transaction<\/td><td>You receive only matches<\/td><\/tr><tr><td>Filter logic<\/td><td>Anything you can write<\/td><td>Limited to supported params<\/td><\/tr><tr><td>Portability<\/td><td>Works on any endpoint<\/td><td>Tied to one provider&#8217;s method<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A common middle path: filter server-side on <code>to<\/code>\/<code>from<\/code> to cut the volume, then apply the finer logic \u2014 value thresholds, selector matching \u2014 in your own code.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-happens-when-the-socket-drops\">What Happens When the Socket Drops?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">It will drop, so plan for it. A provider-side deploy, an idle timeout, or a network blip closes the connection eventually, and an app that assumes the socket stays open forever will silently stop receiving transactions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The reconnection pattern is standard: detect the close, open a new connection, and re-subscribe. Pending data carries one wrinkle that block data does not. When you reconnect after missing blocks, you can backfill them over HTTP. You cannot backfill a mempool \u2014 the transactions you missed were never stored anywhere queryable, and many have already been mined or dropped. For a pending stream, reconnecting means accepting the gap and resuming, then reconciling against confirmed blocks if your logic needs certainty about what actually landed.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Opening the subscription is the easy 10% of this job. The part that decides whether your stream is usable is the filter: standard <code>newPendingTransactions<\/code> plus client-side logic when you want portability and full control, or a provider&#8217;s filtered subscription when the raw volume is too high to receive. Build the subscribe-resolve-filter loop, handle the null transactions, and wire in reconnection from the first commit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Underneath all of it sits the same requirement \u2014 a low-latency WebSocket endpoint that stays open so you don&#8217;t miss what you&#8217;re watching for. When a standard subscription is no longer enough and you need higher-throughput, server-side-filtered delivery, <a href=\"https:\/\/nownodes.io\/grpc\">gRPC streaming<\/a> covers that next step on supported chains. Match the tool to how narrow your target is, and let the provider hold the socket open while you focus on the logic.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"can-i-avoid-the-extra-gettransactionbyhash-call-for-every-hash\">Can I avoid the extra getTransactionByHash call for every hash?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Yes, in two ways. On Geth, pass <code>true<\/code> as the second argument to <code>newPendingTransactions<\/code> to stream full bodies. With an enhanced feed such as <code>alchemy_pendingTransactions<\/code>, set <code>hashesOnly<\/code> to <code>false<\/code>. Both skip the follow-up call, at the cost of a heavier stream and, for the enhanced feed, a provider-specific method.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"what-happens-to-a-pending-transaction-im-streaming-if-its-dropped-or-replaced\">What happens to a pending transaction I&#8217;m streaming if it&#8217;s dropped or replaced?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Nothing is pushed to tell you. The standard subscription emits a hash when a transaction enters the pool, but there is no &#8220;removed&#8221; event when one is dropped, replaced, or mined. If you need to know an outcome, reconcile the hashes you&#8217;ve seen against newly confirmed blocks rather than waiting for a signal that never comes.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"can-i-stream-pending-transactions-on-layer2s-and-nonethereum-chains\">Can I stream pending transactions on layer-2s and non-Ethereum chains?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">It varies. Many EVM chains expose <code>newPendingTransactions<\/code>, but some layer-2 networks sequence transactions in a way that offers no public pending feed at all, so there is nothing to subscribe to. Non-EVM chains use entirely different interfaces. Always confirm that your specific network supports the subscription before building against it.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"should-i-filter-in-my-own-code-or-on-the-providers-side\">Should I filter in my own code or on the provider&#8217;s side?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Filter client-side when you want portability across providers and arbitrary logic, and can afford to receive the full stream. Filter server-side when the volume is high and your target is a known set of addresses \u2014 you receive far less data, but you&#8217;re tied to that provider&#8217;s method. Combining the two, coarse server-side then fine client-side, is often the most practical setup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You stream pending transactions by opening a WebSocket subscription to newPendingTransactions, then resolving each hash the socket pushes into a full transaction object. You filter that stream in one of two places: in your own code after decoding each transaction, or on the provider&#8217;s side with a subscription that only sends you matches. The default [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":3889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-3886","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Stream &amp; Filter Ethereum Pending Transactions (WebSocket)<\/title>\n<meta name=\"description\" content=\"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stream &amp; Filter Ethereum Pending Transactions (WebSocket)\" \/>\n<meta property=\"og:description\" content=\"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\" \/>\n<meta property=\"og:site_name\" content=\"NOWNodes Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-09T10:11:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-09T10:11:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/nodes_1-92.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u0410nastasia\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nownodes\" \/>\n<meta name=\"twitter:site\" content=\"@nownodes\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0410nastasia\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\"},\"author\":{\"name\":\"\u0410nastasia\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8\"},\"headline\":\"How to Stream and Filter Pending Transactions on Ethereum over WebSocket\",\"datePublished\":\"2026-10-09T10:11:54+00:00\",\"dateModified\":\"2026-10-09T10:11:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\"},\"wordCount\":1885,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"articleSection\":[\"General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\",\"url\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\",\"name\":\"Stream & Filter Ethereum Pending Transactions (WebSocket)\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#website\"},\"datePublished\":\"2026-10-09T10:11:54+00:00\",\"dateModified\":\"2026-10-09T10:11:55+00:00\",\"description\":\"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.\",\"breadcrumb\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/nownodes.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\/\/nownodes.io\/blog\/category\/general\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Stream and Filter Pending Transactions on Ethereum over WebSocket\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nownodes.io\/blog\/#website\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"name\":\"NOWNodes Blog\",\"description\":\"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes\",\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nownodes.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\",\"name\":\"NOWNodes Blog\",\"url\":\"https:\/\/nownodes.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"contentUrl\":\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png\",\"width\":1164,\"height\":1164,\"caption\":\"NOWNodes Blog\"},\"image\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/nownodes\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8\",\"name\":\"\u0410nastasia\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1de24ab8dcdd7ec30f6adaf78b56bc1eda421f87575b7e103c8fc3fc4420e833?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1de24ab8dcdd7ec30f6adaf78b56bc1eda421f87575b7e103c8fc3fc4420e833?s=96&d=mm&r=g\",\"caption\":\"\u0410nastasia\"},\"url\":\"https:\/\/nownodes.io\/blog\/author\/nasty-nownodes\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stream & Filter Ethereum Pending Transactions (WebSocket)","description":"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/","og_locale":"en_US","og_type":"article","og_title":"Stream & Filter Ethereum Pending Transactions (WebSocket)","og_description":"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.","og_url":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/","og_site_name":"NOWNodes Blog","article_published_time":"2026-10-09T10:11:54+00:00","article_modified_time":"2026-10-09T10:11:55+00:00","og_image":[{"width":2400,"height":1200,"url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2026\/10\/nodes_1-92.jpg","type":"image\/jpeg"}],"author":"\u0410nastasia","twitter_card":"summary_large_image","twitter_creator":"@nownodes","twitter_site":"@nownodes","twitter_misc":{"Written by":"\u0410nastasia","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#article","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/"},"author":{"name":"\u0410nastasia","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8"},"headline":"How to Stream and Filter Pending Transactions on Ethereum over WebSocket","datePublished":"2026-10-09T10:11:54+00:00","dateModified":"2026-10-09T10:11:55+00:00","mainEntityOfPage":{"@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/"},"wordCount":1885,"commentCount":0,"publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"articleSection":["General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/","url":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/","name":"Stream & Filter Ethereum Pending Transactions (WebSocket)","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/#website"},"datePublished":"2026-10-09T10:11:54+00:00","dateModified":"2026-10-09T10:11:55+00:00","description":"Stream Ethereum pending transactions over WebSocket and filter them by address, value, or method \u2014 using ethers v6, viem, and enhanced provider subscriptions.","breadcrumb":{"@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nownodes.io\/blog\/how-to-stream-and-filter-pending-transactions-on-ethereum-over-websocket\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/nownodes.io\/blog"},{"@type":"ListItem","position":2,"name":"General","item":"https:\/\/nownodes.io\/blog\/category\/general"},{"@type":"ListItem","position":3,"name":"How to Stream and Filter Pending Transactions on Ethereum over WebSocket"}]},{"@type":"WebSite","@id":"https:\/\/nownodes.io\/blog\/#website","url":"https:\/\/nownodes.io\/blog\/","name":"NOWNodes Blog","description":"Your first-to-go source of development guides, web3 analytics and most recent news about NOWNodes","publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nownodes.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/nownodes.io\/blog\/#organization","name":"NOWNodes Blog","url":"https:\/\/nownodes.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","contentUrl":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2024\/02\/cropped-New-Logo-NN.png","width":1164,"height":1164,"caption":"NOWNodes Blog"},"image":{"@id":"https:\/\/nownodes.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/nownodes"]},{"@type":"Person","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8","name":"\u0410nastasia","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1de24ab8dcdd7ec30f6adaf78b56bc1eda421f87575b7e103c8fc3fc4420e833?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1de24ab8dcdd7ec30f6adaf78b56bc1eda421f87575b7e103c8fc3fc4420e833?s=96&d=mm&r=g","caption":"\u0410nastasia"},"url":"https:\/\/nownodes.io\/blog\/author\/nasty-nownodes"}]}},"modified_by":"\u0410nastasia","_links":{"self":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/3886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/comments?post=3886"}],"version-history":[{"count":1,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/3886\/revisions"}],"predecessor-version":[{"id":3890,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/3886\/revisions\/3890"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media\/3889"}],"wp:attachment":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media?parent=3886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/categories?post=3886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/tags?post=3886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}