{"id":1441,"date":"2026-09-18T16:24:14","date_gmt":"2026-09-18T16:24:14","guid":{"rendered":"https:\/\/nownodes.io\/blog\/?p=1441"},"modified":"2026-09-18T16:24:16","modified_gmt":"2026-09-18T16:24:16","slug":"how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api","status":"publish","type":"post","link":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/","title":{"rendered":"How to Fetch Smart Contract Events Using the Ethereum Blockchain API"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You fetch smart contract events from Ethereum with the <code>eth_getLogs<\/code> JSON-RPC method for historical data, or an <code>eth_subscribe<\/code> WebSocket subscription for events as they happen. Both read from the same underlying data structure \u2014 the event logs a contract writes when it fires an event \u2014 just on different timelines. This guide walks through what that data actually is, why it exists, who queries it, and how to pull it correctly once your queries get bigger than a single test transaction.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-smart-contract-events-and-why-do-logs-exist\">What Are Smart Contract Events, and Why Do Logs Exist?<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"1024\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-972x1024.png\" alt=\"\" class=\"wp-image-3403\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-972x1024.png 972w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-285x300.png 285w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-767x808.png 767w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image.png 1222w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A smart contract event is a message a contract emits during execution to record that something happened, without writing that data into the contract&#8217;s own storage. When a Solidity contract runs <code>emit Transfer(from, to, amount)<\/code>, the Ethereum Virtual Machine writes a log entry attached to that transaction&#8217;s receipt rather than saving it as contract state.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That distinction is deliberate, and it comes down to gas. Writing 32 bytes to contract storage costs 20,000 gas, while a log costs a flat 375 gas plus 375 gas per topic plus 8 gas per byte of data, according to <a href=\"https:\/\/ethos.dev\/events-and-logs-in-ethereum\">ethos.dev&#8217;s breakdown of Ethereum&#8217;s gas schedule<\/a>. Logs were built as a cheap, write-only record \u2014 a contract can emit one but can&#8217;t read it back, which is why anything the contract itself needs later still has to live in storage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each log carries two kinds of parameters: indexed and non-indexed. Indexed parameters go into the log&#8217;s <code>topics<\/code> array and can be filtered directly in a query; non-indexed parameters get packed into the <code>data<\/code> field and have to be decoded afterward. A Solidity event can mark up to three parameters as <code>indexed<\/code>, and the event&#8217;s own signature hash fills the first topic slot automatically, so a single log tops out at four topics total.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-do-developers-need-to-fetch-contract-events\">Why Do Developers Need to Fetch Contract Events?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">The practical problem is that logs are the only efficient way to reconstruct what a contract has done over time. Re-running every historical transaction against a contract to rebuild its history would mean replaying the entire chain&#8217;s execution, which no application can afford to do on every page load.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Events solve this by giving you a queryable trail without touching contract state at all. A DEX doesn&#8217;t store a list of every swap that ever happened \u2014 it emits a <code>Swap<\/code> event on each trade and lets anyone who cares reconstruct that history from the logs. That&#8217;s also why an ERC-20 token contract typically doesn&#8217;t store a full transfer history on-chain; the <code>Transfer<\/code> event is the record, and it&#8217;s up to wallets, explorers, and indexers to collect it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This matters for anything that needs to show activity rather than just current state. Current state answers &#8220;what is my balance right now&#8221;; event logs answer &#8220;how did it get there.&#8221;<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"who-actually-queries-event-data\">Who Actually Queries Event Data?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">A handful of distinct groups pull event logs, each for a different reason:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Wallets and portfolio trackers<\/strong> watch <code>Transfer<\/code> events to detect incoming funds and rebuild transaction history for an address.<\/li>\n\n\n\n<li><strong>Block explorers<\/strong> decode logs to show a human-readable activity feed under every contract and transaction.<\/li>\n\n\n\n<li><strong>DeFi dashboards and analytics platforms<\/strong> aggregate <code>Swap<\/code>, <code>Mint<\/code>, and <code>Burn<\/code> events to calculate volume, liquidity, and price history.<\/li>\n\n\n\n<li><strong>Indexers and subgraphs<\/strong> ingest logs continuously to power the fast, filtered queries that a raw node can&#8217;t serve efficiently.<\/li>\n\n\n\n<li><strong>Security teams<\/strong> monitor specific events \u2014 a large withdrawal, an ownership transfer, a pause function \u2014 to catch exploits or unusual activity close to real time.<\/li>\n\n\n\n<li><strong>Exchanges and payment processors<\/strong> watch deposit-address <code>Transfer<\/code> events to credit user accounts without polling every block manually.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The common thread is that none of these groups want to run their own execution against every past block. They want a filtered, decoded slice of history, and <code>eth_getLogs<\/code> is what makes that possible without a full archive replay.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-fetch-events-with-ethgetlogs\">How to Fetch Events With eth_getLogs<\/h2>\n\n\n<p class=\"wp-block-paragraph\"><code>eth_getLogs<\/code> takes a filter object and returns every log matching it. Here&#8217;s the sequence for a typical query against an ERC-20 <code>Transfer<\/code> event.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Compute the event signature hash.<\/strong> Take <code>keccak256(\"Transfer(address,address,uint256)\")<\/code>, which produces <code>0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef<\/code>. This becomes <code>topics[0]<\/code> in your filter \u2014 it&#8217;s how the node knows which event you&#8217;re asking for.<\/li>\n\n\n\n<li><strong>Set the block range.<\/strong> Provide <code>fromBlock<\/code> and <code>toBlock<\/code>, either as hex block numbers or tags like <code>\"latest\"<\/code>. A tighter range returns faster and is less likely to hit a provider&#8217;s size limit.<\/li>\n\n\n\n<li><strong>Specify the contract address.<\/strong> This narrows the search to logs from one contract instead of scanning every log in the range.<\/li>\n\n\n\n<li><strong>Add topic filters for indexed parameters<\/strong>, if you want to filter further \u2014 for example, <code>topics[1]<\/code> set to a specific sender address, left-padded to 32 bytes.<\/li>\n\n\n\n<li><strong>Send the request and decode the response.<\/strong> Non-indexed values arrive in the <code>data<\/code> field as packed hex and need an ABI decoder \u2014 <code>viem<\/code>&#8216;s <code>decodeEventLog<\/code> or ethers.js&#8217;s <code>Interface.parseLog<\/code> both handle this.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">A minimal request looks like this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getLogs\",\n  \"params\": &#91;{\n    \"address\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n    \"fromBlock\": \"0x112A880\",\n    \"toBlock\": \"0x112A8F0\",\n    \"topics\": &#91;\n      \"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"\n    ]\n  }]\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each log in the response includes <code>blockNumber<\/code>, <code>transactionHash<\/code>, <code>address<\/code>, <code>topics<\/code>, and <code>data<\/code> \u2014 enough to trace exactly which transaction produced it, even before you decode the payload.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"realtime-events-with-websocket-subscriptions\">Real-Time Events With WebSocket Subscriptions<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Polling <code>eth_getLogs<\/code> on a timer works, but it wastes requests waiting for something that might not have happened yet. For anything that needs to react as events land \u2014 a bot watching for a specific <code>Swap<\/code>, a dashboard updating live \u2014 a WebSocket subscription is the better fit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>eth_subscribe<\/code> method with a <code>\"logs\"<\/code> parameter pushes matching log entries to your client the moment a node processes them, over one persistent connection instead of repeated HTTP calls:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">json<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_subscribe\",\n  \"params\": &#91;\"logs\", {\n    \"address\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n    \"topics\": &#91;\"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\"]\n  }]\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/nownodes.io\/wss\">NOWNodes&#8217; WebSocket API<\/a> supports this subscription pattern on Ethereum, so an application can stream event data without maintaining an always-on connection to its own client. The trade-off against <code>eth_getLogs<\/code> is straightforward: subscriptions are for what&#8217;s happening now, while <code>eth_getLogs<\/code> is what you reach for to backfill everything that happened before your listener was running.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"what-are-the-real-limits-of-ethgetlogs\">What Are the Real Limits of eth_getLogs?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">This is where most <code>eth_getLogs<\/code> implementations run into trouble, because providers cap queries differently and none of it is standardized. Elan Halpern, who works on developer experience at Alchemy, put the core tension plainly: leave the block range too open and &#8220;we can risk trying to query millions of logs&#8221; against a single request, which is exactly what providers are built to prevent.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The caps themselves vary widely. Alchemy allows a 2,000-block range with no response-size limit, or any block range capped at 10,000 logs in the response \u2014 whichever fits your query better, according to <a href=\"https:\/\/medium.com\/alchemy-api\/deep-dive-into-eth-getlogs-5faf6a66fd81\">Halpern&#8217;s deep dive into the method<\/a>. QuickNode&#8217;s default cap sits at 10,000 blocks per request, <a href=\"https:\/\/support.quicknode.com\/hc\/en-us\/articles\/10258449939473-Understanding-the-10-000-Block-Range-Limit-for-querying-Logs-and-Events\">as its support documentation explains<\/a>, while a survey by indexing provider SQD found free public endpoints ranging from 50 blocks per query up to 1,000, <a href=\"https:\/\/sqd.dev\/learn\/eth-getlogs-limits\/\">with no consistency between them<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Provider \/ endpoint type<\/th><th>Typical range or size limit<\/th><\/tr><\/thead><tbody><tr><td>Alchemy<\/td><td>2,000 blocks (unlimited response) or unlimited range (10,000-log response cap)<\/td><\/tr><tr><td>QuickNode<\/td><td>10,000 blocks by default<\/td><\/tr><tr><td>Public free endpoints (varies)<\/td><td>As low as 50\u20131,000 blocks per query<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Three practical consequences follow from this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pagination is mandatory for wide historical queries.<\/strong> Split a multi-year range into chunks that fit under whichever cap your endpoint enforces, and loop through them.<\/li>\n\n\n\n<li><strong>Archive access matters for older data.<\/strong> A pruned node only keeps recent state, so queries reaching back beyond its retention window need <a href=\"https:\/\/nownodes.io\/nodes\/ethereum-eth\">an archive-enabled endpoint<\/a>.<\/li>\n\n\n\n<li><strong>Bloom filters aren&#8217;t perfectly complete.<\/strong> SQD documented a case on Polygon where <code>eth_getLogs<\/code> returned 848 logs for a block whose transaction receipts actually contained 856 \u2014 eight state-sync logs missing from the bloom index, with no error to flag the gap. It&#8217;s a rare edge case, but a reminder that <code>eth_getLogs<\/code> results are only as reliable as the index behind them.<\/li>\n<\/ul>\n\n\n<h2 class=\"wp-block-heading\" id=\"when-should-you-use-an-indexer-instead-of-direct-queries\">When Should You Use an Indexer Instead of Direct Queries?<\/h2>\n\n\n<p class=\"wp-block-paragraph\"><code>eth_getLogs<\/code> is the right tool when you know the contract, the event, and roughly the block range you need. It gets impractical once you need to join event data across many contracts, run complex filters, or serve fast queries to end users at scale \u2014 that&#8217;s the gap indexing services like The Graph are built to fill.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Approach<\/th><th>Best for<\/th><th>Trade-off<\/th><\/tr><\/thead><tbody><tr><td>Direct <code>eth_getLogs<\/code><\/td><td>Known contract, known event, moderate range<\/td><td>You manage pagination and rate limits yourself<\/td><\/tr><tr><td>WebSocket subscription<\/td><td>Real-time monitoring of new events<\/td><td>No historical backfill on its own<\/td><\/tr><tr><td>Subgraph \/ indexer<\/td><td>Cross-contract queries, high query volume, GraphQL access<\/td><td>Added infrastructure and indexing lag to account for<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Most production applications end up using more than one of these together: a subscription for live updates, <code>eth_getLogs<\/code> for backfilling history on first load, and an indexer once query complexity outgrows what direct log queries can serve efficiently.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-decode-event-logs-correctly\">How to Decode Event Logs Correctly<\/h2>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"1024\" src=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-1-972x1024.png\" alt=\"\" class=\"wp-image-3404\" srcset=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-1-972x1024.png 972w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-1-285x300.png 285w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-1-767x808.png 767w, https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/image-1.png 1222w\" sizes=\"auto, (max-width: 972px) 100vw, 972px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Getting a raw log back is only half the job \u2014 the <code>data<\/code> field is packed hex that means nothing without the contract&#8217;s ABI. Both major libraries handle this: <code>viem<\/code>&#8216;s <code>decodeEventLog<\/code> and ethers.js&#8217;s <code>Interface.parseLog<\/code> take the ABI fragment for the event and return named, typed values instead of a hex blob.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One nuance catches developers off guard: indexing a dynamic type \u2014 a <code>string<\/code>, <code>bytes<\/code>, or array \u2014 doesn&#8217;t put the actual value in <code>topics<\/code>. It stores <code>keccak256<\/code> of that value instead, because a topic slot is a fixed 32 bytes and a dynamic type has no fixed size. You can filter by that hash to check for an exact match, but you can&#8217;t recover the original string from the topic itself; it has to come from elsewhere in the transaction, such as an unindexed copy of the same value in <code>data<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Getting an accurate picture of a contract&#8217;s activity also means checking <a href=\"https:\/\/nownodes.io\/blog\/what-are-ethereum-transactions\/\">what actually goes into an Ethereum transaction<\/a> in the first place \u2014 logs are a byproduct of execution, and understanding the transaction that produced them makes debugging a missing or unexpected event much faster.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"fetching-events-at-scale-with-nownodes\">Fetching Events at Scale With NOWNodes<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Once event queries move past occasional lookups into continuous monitoring, the constraint usually isn&#8217;t the query logic \u2014 it&#8217;s how much request volume and uptime the underlying endpoint can sustain. <a href=\"https:\/\/nownodes.io\/nodes\/ethereum-eth\">NOWNodes&#8217; Ethereum endpoint<\/a> exposes <code>eth_getLogs<\/code> alongside archive access and WebSocket subscriptions on the same network, so a team can pair historical backfills with live monitoring without switching providers between the two.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For workloads that run high query volumes around the clock \u2014 a security monitor scanning thousands of contracts, or an indexer rebuilding history for a large protocol \u2014 <a href=\"https:\/\/nownodes.io\/dedicated-nodes\">a dedicated endpoint<\/a> removes the shared-quota ceiling that a standard plan enforces, since throughput is then bound by allocated hardware rather than a fixed request count. That&#8217;s a different problem than the query mechanics covered above, but it&#8217;s the one that shows up first once event-fetching moves from a script into production infrastructure.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Fetching smart contract events comes down to picking the right tool for the timeframe: <code>eth_getLogs<\/code> for anything already on-chain, a WebSocket subscription for anything still happening. The mechanics \u2014 topic hashes, block ranges, ABI decoding \u2014 are the same regardless of provider, but the caps and edge cases around them aren&#8217;t, so it&#8217;s worth checking a provider&#8217;s specific limits before building a pagination strategy around assumed defaults. Get that part right, and event logs turn into exactly what they were designed to be: a cheap, complete record of what a contract has done, without ever touching its storage.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">FAQ<\/h2>\n\n<h3 class=\"wp-block-heading\" id=\"can-ethgetlogs-return-logs-from-internal-contract-calls\">Can eth_getLogs return logs from internal contract calls?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Yes. Logs are attached to the transaction, not the specific call frame, so <code>eth_getLogs<\/code> returns events emitted by any contract touched during that transaction&#8217;s execution \u2014 not just the one the transaction was sent to directly.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"how-many-topics-can-a-single-log-have\">How many topics can a single log have?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Four. Topic 0 is always the keccak256 hash of the event signature, and Solidity allows up to three additional parameters to be marked <code>indexed<\/code>, filling topics 1 through 3.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"do-i-need-an-archive-node-to-query-old-events\">Do I need an archive node to query old events?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">It depends on the range and the endpoint&#8217;s pruning policy. Many providers keep enough recent history for typical queries, but reaching back further \u2014 months or years \u2014 generally requires an archive-enabled endpoint rather than a standard pruned one.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"what-happens-if-a-query-exceeds-a-providers-log-limit\">What happens if a query exceeds a provider&#8217;s log limit?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">The request fails with an error naming the limit, rather than returning partial results. The fix is splitting the query into smaller block ranges and looping through them, not retrying the same range.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"can-i-filter-on-nonindexed-event-parameters-directly\">Can I filter on non-indexed event parameters directly?<\/h3>\n\n\n<p class=\"wp-block-paragraph\">No. <code>eth_getLogs<\/code> can only filter using the <code>topics<\/code> array, which covers the event signature and indexed parameters. Anything stored only in <code>data<\/code> has to be fetched broadly and filtered client-side after decoding.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You fetch smart contract events from Ethereum with the eth_getLogs JSON-RPC method for historical data, or an eth_subscribe WebSocket subscription for events as they happen. Both read from the same underlying data structure \u2014 the event logs a contract writes when it fires an event \u2014 just on different timelines. This guide walks through what [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1442,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","_lmt_disableupdate":"","_lmt_disable":"","_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-node-guides"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ethereum Smart Contract Events: eth_getLogs &amp; WebSocket Guide<\/title>\n<meta name=\"description\" content=\"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.\" \/>\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-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ethereum Smart Contract Events: eth_getLogs &amp; WebSocket Guide\" \/>\n<meta property=\"og:description\" content=\"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\" \/>\n<meta property=\"og:site_name\" content=\"NOWNodes Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-18T16:24:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-18T16:24:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/coin_13-6.png\" \/>\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\/png\" \/>\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=\"10 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-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\"},\"author\":{\"name\":\"\u0410nastasia\",\"@id\":\"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8\"},\"headline\":\"How to Fetch Smart Contract Events Using the Ethereum Blockchain API\",\"datePublished\":\"2026-09-18T16:24:14+00:00\",\"dateModified\":\"2026-09-18T16:24:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\"},\"wordCount\":2031,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#organization\"},\"articleSection\":[\"Node Guides\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\",\"url\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\",\"name\":\"Ethereum Smart Contract Events: eth_getLogs & WebSocket Guide\",\"isPartOf\":{\"@id\":\"https:\/\/nownodes.io\/blog\/#website\"},\"datePublished\":\"2026-09-18T16:24:14+00:00\",\"dateModified\":\"2026-09-18T16:24:16+00:00\",\"description\":\"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.\",\"breadcrumb\":{\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/nownodes.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Node Guides\",\"item\":\"https:\/\/nownodes.io\/blog\/category\/node-guides\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Fetch Smart Contract Events Using the Ethereum Blockchain API\"}]},{\"@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":"Ethereum Smart Contract Events: eth_getLogs & WebSocket Guide","description":"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.","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-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/","og_locale":"en_US","og_type":"article","og_title":"Ethereum Smart Contract Events: eth_getLogs & WebSocket Guide","og_description":"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.","og_url":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/","og_site_name":"NOWNodes Blog","article_published_time":"2026-09-18T16:24:14+00:00","article_modified_time":"2026-09-18T16:24:16+00:00","og_image":[{"width":2400,"height":1200,"url":"https:\/\/nownodes.io\/blog\/wp-content\/uploads\/2025\/06\/coin_13-6.png","type":"image\/png"}],"author":"\u0410nastasia","twitter_card":"summary_large_image","twitter_creator":"@nownodes","twitter_site":"@nownodes","twitter_misc":{"Written by":"\u0410nastasia","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#article","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/"},"author":{"name":"\u0410nastasia","@id":"https:\/\/nownodes.io\/blog\/#\/schema\/person\/0890ec68e813adecb93c18ee00e1e7a8"},"headline":"How to Fetch Smart Contract Events Using the Ethereum Blockchain API","datePublished":"2026-09-18T16:24:14+00:00","dateModified":"2026-09-18T16:24:16+00:00","mainEntityOfPage":{"@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/"},"wordCount":2031,"commentCount":0,"publisher":{"@id":"https:\/\/nownodes.io\/blog\/#organization"},"articleSection":["Node Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/","url":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/","name":"Ethereum Smart Contract Events: eth_getLogs & WebSocket Guide","isPartOf":{"@id":"https:\/\/nownodes.io\/blog\/#website"},"datePublished":"2026-09-18T16:24:14+00:00","dateModified":"2026-09-18T16:24:16+00:00","description":"How to fetch Ethereum smart contract events with eth_getLogs and WebSocket subscriptions \u2014 plus provider limits, ABI decoding, and edge cases.","breadcrumb":{"@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/nownodes.io\/blog\/how-to-fetch-smart-contract-events-using-the-ethereum-blockchain-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/nownodes.io\/blog"},{"@type":"ListItem","position":2,"name":"Node Guides","item":"https:\/\/nownodes.io\/blog\/category\/node-guides"},{"@type":"ListItem","position":3,"name":"How to Fetch Smart Contract Events Using the Ethereum Blockchain API"}]},{"@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\/1441","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=1441"}],"version-history":[{"count":2,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions"}],"predecessor-version":[{"id":3405,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions\/3405"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media\/1442"}],"wp:attachment":[{"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/media?parent=1441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/categories?post=1441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nownodes.io\/blog\/wp-json\/wp\/v2\/tags?post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}