{"uid":"cap_7Ngjj1vbnxW-FSKUVq7Nc","slug":"on-chain-block-height-58d40635","name":"On-chain Block / Height","description":"","url":"https://agent-commerce-factory-jm.austriaeast.cloudapp.azure.com/v1/onchain/block","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":[],"properties":{"block":{"type":"integer","minimum":0,"description":"Block number; omit for the latest block."},"chain":{"type":"string","default":"ethereum","description":"EVM chain (ethereum, base, arbitrum, optimism, polygon, bsc)."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["machine","route","block"],"properties":{"block":{"type":"object","properties":{"hash":{"type":["string","null"]},"chain":{"type":["string","null"]},"miner":{"type":["string","null"]},"number":{"type":["integer","null"]},"gasUsed":{"type":["string","null"]},"txCount":{"type":["integer","null"]},"gasLimit":{"type":["string","null"]},"timestamp":{"type":["string","null"]},"parentHash":{"type":["string","null"]},"timestampUnix":{"type":["integer","null"]},"baseFeePerGasWei":{"type":["string","null"]}}},"chain":{"type":"string"},"route":{"type":"string"},"machine":{"type":"string"},"economics":{"type":"object","properties":{"sellPriceUsd":{"type":"number"},"upstreamCostUsdActual":{"type":["number","null"]}}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TNQezDYWeAX6MXHAzSmr1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetch EVM block metadata (latest or by number) including hash, timestamp, gas, miner, and transaction count for a given chain.","exampleAgentPrompt":"What's the current block height on Ethereum, and can you also pull the full block details — hash, timestamp, gas used, base fee, and miner — for the latest block?","exampleUseCases":[{"title":"Chain-tip monitoring for finality tracking","prompt":"Keep checking the latest Ethereum block number every few seconds and alert me when we're 12 blocks past block 19500000 — I need to confirm finality for a transaction."},{"title":"Block explorer data lookup","prompt":"Pull up all the details for Arbitrum block 150000000 — I need the hash, parent hash, timestamp, gas used, gas limit, base fee, and miner address."},{"title":"Cross-chain block height comparison","prompt":"What are the current block heights on Ethereum, Base, and Polygon right now? I want to compare how far along each chain is."}],"resultDescription":"Returns a structured object with the block's number, hash, parent hash, Unix timestamp, transaction count, gas used, gas limit, base fee per gas, and miner address for the specified EVM chain and block number (or latest block if no number is provided).","failureModes":["Invalid or unsupported chain name returns an error — use only supported chains: ethereum, base, arbitrum, optimism, polygon, bsc","Block number exceeds current chain height returns not-found or invalid block error","Negative or non-integer block number rejected by schema validation","RPC node unavailability for a specific chain may cause timeout or 503","Payment failure (x402) blocks the request if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when you need on-chain block metadata — height, hash, gas stats, timestamp, or miner — for any supported EVM chain (Ethereum, Base, Arbitrum, Optimism, Polygon, BSC). Ideal for indexers needing chain-tip data, agents tracking finality, block explorer bots, or any workflow that needs to anchor activity to a specific block. Prefer this over general crypto price endpoints when you need structural blockchain data rather than market data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:37:38.830Z","isFirstParty":false}