{"uid":"cap_rnchm8TQLeZTF-D5qHsl4","slug":"block-data-base-optimism-ethereum-mainnet-97e25735","name":"Block Data (Base / Optimism / Ethereum Mainnet)","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/block","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"block":{"type":"string","description":"Block reference: latest (default), earliest, or a block number in decimal or 0x hex"},"chain":{"enum":["base","op","mainnet"],"type":"string","description":"Chain to query (default base)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["network","block","found"],"properties":{"block":{"type":"string"},"found":{"type":"boolean"},"number":{"type":"number"},"network":{"type":"string"},"timestamp":{"type":"number"},"baseFeeGwei":{"type":["number","null"]},"timestampIso":{"type":"string"},"transactionCount":{"type":"number"}}}}}}},"responseSchema":{"type":"json","example":{"hash":"0x941a93c4a4d7c5f2c14b0a4f3c6b1f7a0a5b4e3d2c1f0e9a8b7c6d5e4f3a2b1c0","block":"latest","found":true,"number":24400123,"gasUsed":8501234,"network":"base","gasLimit":30000000,"proposer":"0x0000000000000000000000000000000000000000","sizeBytes":81234,"timestamp":1786123456,"parentHash":"0x8b3a1f9c7e2d4b6a8f0c3e5d7a9b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c","baseFeeGwei":0.01,"requestedAt":"2026-08-05T00:44:16.000Z","timestampIso":"2026-08-05T00:44:16.000Z","baseFeePerGasWei":"10000000","transactionCount":212}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.1","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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_f0rT0K5ufN_tA8fEG6VZI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.1","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns block metadata — number, hash, timestamp, baseFee, gas usage, transaction count, proposer, and size — for any block on Base, Optimism, or Ethereum Mainnet","exampleAgentPrompt":"What's the current block number, timestamp, and base fee in gwei on Base right now?","exampleUseCases":[{"title":"Pre-transaction network cost check","prompt":"Before I send a transaction on Base, can you grab the latest block and tell me the current base fee in gwei and how busy the network is?"},{"title":"On-chain timestamp proof for a specific block","prompt":"I need the exact UTC timestamp and hash for block 19500000 on Ethereum mainnet — I want to verify when that block was mined."},{"title":"Optimism gas monitoring","prompt":"What's the current base fee and gas limit on Optimism? I want to know if the network is congested before I submit anything."}],"resultDescription":"A JSON object containing: network name, block reference queried, found boolean, block number, block hash, unix timestamp, ISO timestamp, baseFee in wei, baseFee in gwei, gasUsed, gasLimit, transactionCount, block proposer address, and block size.","failureModes":["Invalid chain value (not base/op/mainnet) returns error","Block number not found or out of range returns found: false","Malformed block hex reference returns parsing error","RPC backend unavailable returns 500 or timeout","Payment not included or invalid returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need a real-time or historical network snapshot on Base, Optimism, or Ethereum Mainnet — especially to verify current gas costs (baseFee), confirm block timestamps for proof-of-time, or assess network congestion before submitting a transaction. It is the right choice over raw RPC calls when you want a single normalized REST call that returns all key block fields in one response without writing Web3 code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:44:15.959Z","isFirstParty":false}