{"uid":"cap_PW3xmrURD53q7GucLCbgR","slug":"on-chain-event-logs-eth-getlogs-base-optimism-ethereum-53b538cd","name":"On-Chain Event Logs (eth_getLogs) — Base, Optimism, Ethereum","description":"Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.","url":"https://x402-audit.tatschluizguilherme.workers.dev/events","method":"GET","headers":{},"bodySchema":null,"responseSchema":{"type":"json","example":{"count":5,"events":[{"data":"0x00000000000000000000000000000000000000000000000000000000025d68b2","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000001231deb6f5749ef6ce6943a275a1d3e7486f4eae","0x0000000000000000000000001e55b1e12a40e0fe376e122327c29a982406c1b5"],"txHash":"0xb7ddecbd…","address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","decoded":{"args":{"to":"0x1e55…","from":"0x1231…","value":"39679954","symbol":"USDC","valueFormatted":"39.679954"},"event":"Transfer"},"logIndex":12,"timestamp":1785914235,"blockNumber":49548044,"timestampISO":"2026-08-04T23:17:15.000Z"}],"address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","network":"base","toBlock":"49548044","fromBlock":"49543044","truncated":true,"blockRange":"5000","requestedAt":"2026-08-05T02:20:00.000Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.1/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.1","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KpDXn4VgLz7F4-ia-Az5g","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches raw and decoded EVM event logs for any contract or wallet across Base, Optimism, or Ethereum Mainnet, with best-effort decoding of Transfer, Approval, and Uniswap V3 Swap events","exampleAgentPrompt":"Fetch all Transfer and Uniswap V3 Swap events emitted by the USDC contract on Base from block 18000000 to 18001000, and decode the amounts using the token decimals.","exampleUseCases":[{"title":"Audit token transfers for a wallet","prompt":"Pull all ERC-20 Transfer events involving wallet 0xAbC...123 on Ethereum Mainnet between blocks 19000000 and 19005000, and show me the decoded from/to addresses and formatted token amounts."},{"title":"Monitor Uniswap V3 pool swaps","prompt":"Get me the Uniswap V3 Swap events for the ETH/USDC pool contract 0xDef...456 on Optimism from block 110000000 to 110010000, including sqrtPriceX96, liquidity, and tick values."},{"title":"Inspect smart contract Approval events","prompt":"Fetch all Approval events from the DAI token contract on Ethereum Mainnet for blocks 19100000 to 19105000, showing the owner, spender, and approved amount with proper decimals."}],"resultDescription":"Returns an array of event log objects for the specified address and block range. Decoded events (Transfer, Approval, Uniswap V3 Swap) include human-readable fields with token amounts formatted using contract decimals. All other events are returned raw with topics and data for client-side decoding. Each event includes txHash, logIndex, block number, and per-event timestamp. If the block range is too wide for the RPC, a rangeHint field indicates the maximum accepted range.","failureModes":["Block range too wide — RPC rejects the range; rangeHint returned to guide retry with smaller range","Invalid or non-existent contract address — returns empty logs array","Unsupported chain specified — error indicating only Base, Optimism, and Ethereum Mainnet are supported","RPC node unavailable or rate-limited — upstream error propagated","Payment not settled — x402 payment required error (402 status)","Malformed request body — missing required fields returns validation error"],"whenToPreferThis":"Choose this endpoint when you need on-chain event logs (eth_getLogs) for a specific contract or wallet on Base, Optimism, or Ethereum Mainnet, especially when you want best-effort decoded Transfer, Approval, or Uniswap V3 Swap events without writing your own ABI decoding logic. It's ideal for auditing token movements, inspecting DeFi swap activity, or building event-driven analytics over a defined block range. Prefer over generic blockchain explorers when you need raw + decoded logs together in a single call, or when you need the auto-range-shrinking behavior for busy contracts.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:35:45.615Z","isFirstParty":false}