{"uid":"cap_o5gdvxWeOiq8ZkzdP0n80","slug":"base-gas-history-oracle-x402-4f12a60f","name":"Base Gas History Oracle (x402)","description":"Historical Base mainnet gas prices over a lookback window: time series, min/max/average/median, and a cheap/normal/expensive verdict for the current price.","url":"https://base-gas-x402-production.up.railway.app/gas/history","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","required":[],"properties":{"hours":{"type":"integer","default":24,"maximum":168,"minimum":1,"description":"Lookback window in hours. Defaults to 24. Check the free GET /health route first to see how much history has been collected."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"units":"gwei","samples":[{"t":"2026-07-26T06:00:00.000Z","gasPrice":0.006}],"summary":{"avg":0.009,"max":0.031,"min":0.005,"median":0.007},"verdict":"cheap","requestedHours":24,"currentGasPrice":0.006}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.012","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.012/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.012","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.012","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_wpz80836gnnOulOnGQ_kw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.012","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns historical gas price data for Base mainnet over a configurable lookback window, including a statistical summary and a cheap/normal/expensive verdict, gated via x402 micropayment.","exampleAgentPrompt":"What's the gas price history on Base mainnet over the last 48 hours — is it cheap or expensive right now, and what were the average, min, and max gwei?","exampleUseCases":[{"title":"Pre-transaction gas timing check","prompt":"Before I submit this transaction on Base, can you pull the last 24 hours of gas history and tell me whether gas is cheap right now compared to recent levels?"},{"title":"Weekly gas trend report for DeFi ops","prompt":"Give me a full 7-day gas history for Base mainnet — I want to see the average, min, max, and median gwei and whether conditions are cheap or expensive overall."},{"title":"Automated gas spike alert","prompt":"Check Base gas price history for the last 6 hours and let me know if there's been a spike — I want to know the current price versus the average so I can decide whether to pause my on-chain bot."}],"resultDescription":"Returns a JSON object containing: an array of timestamped gas price samples in gwei, a summary object with avg/min/max/median values, the current gas price in gwei, a human-readable verdict ('cheap', 'normal', or 'expensive'), and the number of hours of history requested.","failureModes":["Payment not received or x402 handshake fails — endpoint returns 402 Payment Required and no data","Invalid hours parameter (outside 1–168 range) — returns validation error","Insufficient history collected — fewer samples than requested hours may be returned; check /health first","Railway host downtime — service may be temporarily unavailable"],"whenToPreferThis":"Choose this endpoint when you need historical gas price context for Base mainnet (chain id 8453) specifically — not just current gas price. It is ideal for agents that need to decide whether 'now' is a good time to transact based on recent trends, or for generating periodic gas reports. It requires no API key or subscription, only a small x402 USDC micropayment per call, making it suitable for pay-as-you-go agent pipelines targeting Base L2.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:38:46.390Z","isFirstParty":false}