{"openapi":"3.1.0","info":{"title":"Plainchain","version":"1.0.0","description":"Pay-per-call chain data for agents: gas, balances, tokens, address type, approvals, transactions, x402 receipt verification and verifiable randomness on Base, Arbitrum, Ethereum and Optimism. x402, USDC on Base, $0.001-$0.01 per call, no keys.","contact":{"email":"plainchain@appin60.com"}},"servers":[{"url":"https://plainchain.pages.dev"}],"paths":{"/v1/gas":{"get":{"summary":"Current gas price on Base, Arbitrum, Ethereum or Optimism, with the USD cost right now of an ETH transfer, ERC-20 transfer, DEX swap and NFT mint","description":"Current gas price on Base, Arbitrum, Ethereum or Optimism, with the USD cost right now of an ETH transfer, ERC-20 transfer, DEX swap and NFT mint. Use before sending a transaction to pick a chain or decide whether to wait.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","chainId":8453,"block":36581662,"gasPriceGwei":0.006,"baseFeeGwei":0.005,"priorityFeeGwei":0.001,"ethUsd":2527.2,"estimates":{"ethTransfer":{"gas":21000,"eth":1.26e-7,"usd":0.000318},"erc20Transfer":{"gas":65000,"eth":3.9e-7,"usd":0.000986},"dexSwap":{"gas":180000,"eth":0.00000108,"usd":0.00273}}}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/block":{"get":{"summary":"Latest block on Base, Arbitrum, Ethereum or Optimism","description":"Latest block on Base, Arbitrum, Ethereum or Optimism: number, hash, timestamp, age in seconds, base fee, gas used and transaction count. Use to check chain liveness or get a fresh block reference.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","chainId":8453,"number":36581662,"hash":"0x9c1e...","timestamp":"2026-10-13T08:40:01.000Z","ageSeconds":1,"baseFeeGwei":0.005,"gasUsed":61234567,"gasLimit":300000000,"txCount":212}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/price":{"get":{"summary":"USD spot price for up to 10 crypto symbols in one call (ETH, BTC, SOL, USDC, ARB, OP and any symbol listed on Coinbase)","description":"USD spot price for up to 10 crypto symbols in one call (ETH, BTC, SOL, USDC, ARB, OP and any symbol listed on Coinbase). Use to value balances or convert amounts.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"symbols","in":"query","required":true,"schema":{"type":"string"},"description":"comma-separated symbols, e.g. ETH,BTC,SOL"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"currency":"USD","prices":{"ETH":2527.22,"BTC":111845.5},"source":"Coinbase spot","at":"2026-10-13T08:40:00.000Z"}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/balances":{"get":{"summary":"Wallet balances with USD values on Base, Arbitrum, Ethereum or Optimism","description":"Wallet balances with USD values on Base, Arbitrum, Ethereum or Optimism: native ETH plus USDC, USDT, WETH and the chain's major tokens, plus up to 10 extra token addresses you pass. Returns a USD total. Use before paying, bridging or reporting a portfolio.","x-price-usd":"0.001942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001942"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"wallet address"},{"name":"tokens","in":"query","required":false,"schema":{"type":"string"},"description":"optional comma-separated extra ERC-20 addresses"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","address":"0x...","native":{"symbol":"ETH","balance":"0.0123","usd":31.08},"tokens":[{"symbol":"USDC","token":"0x8335...","balance":"152.4","usd":152.4}],"totalUsd":183.48}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/token":{"get":{"summary":"ERC-20 token lookup on Base, Arbitrum, Ethereum or Optimism","description":"ERC-20 token lookup on Base, Arbitrum, Ethereum or Optimism: name, symbol, decimals, total supply, plus DEX market data (USD price, liquidity across pairs, 24h volume, 24h price change, FDV, oldest pair age). Use before buying, accepting or pricing an unfamiliar token.","x-price-usd":"0.001942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001942"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"token contract address"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","address":"0x4ed4e862860bed51a9570b96d89af5e1b0efefed","name":"Degen","symbol":"DEGEN","decimals":18,"totalSupply":"36965840682.5","market":{"priceUsd":0.00099,"liquidityUsdAllPairs":113268,"volume24hUsd":32314,"priceChange24hPct":-2.1,"oldestPairCreated":"2024-01-08T00:00:00.000Z"}}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/address":{"get":{"summary":"What is this address? Classifies any address on Base, Arbitrum, Ethereum or Optimism as a plain wallet (EOA), EIP-7702 delegated wallet, Safe multisig (owners and threshold), upgradeable proxy (implementation and admin), ERC-20 token or other contract, with owner(), nonce and ETH balance","description":"What is this address? Classifies any address on Base, Arbitrum, Ethereum or Optimism as a plain wallet (EOA), EIP-7702 delegated wallet, Safe multisig (owners and threshold), upgradeable proxy (implementation and admin), ERC-20 token or other contract, with owner(), nonce and ETH balance. Use before sending funds to or trusting an address.","x-price-usd":"0.001942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001942"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"any address"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","address":"0x8335...","type":"contract","proxy":{"standard":"EIP-1967","implementation":"0x2ce6...","admin":"0x3abd..."},"erc20":{"symbol":"USDC","decimals":6},"summary":"ERC-20 token USDC; upgradeable proxy (EIP-1967) -> 0x2ce6..."}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/allowance":{"get":{"summary":"ERC-20 approval check on Base, Arbitrum, Ethereum or Optimism","description":"ERC-20 approval check on Base, Arbitrum, Ethereum or Optimism: how much a spender may move from an owner's balance, flagged if unlimited. Use before trading, or when auditing a wallet's open approvals.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"owner","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"token holder"},{"name":"token","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"ERC-20 token"},{"name":"spender","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"approved spender, e.g. a router or Permit2"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","symbol":"USDC","allowance":"unlimited","unlimited":true,"risk":"Spender can move the owner's entire balance of this token at any time. Revoke if you no longer use it."}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/tx":{"get":{"summary":"Transaction status and plain-English details on Base, Arbitrum, Ethereum or Optimism","description":"Transaction status and plain-English details on Base, Arbitrum, Ethereum or Optimism: success or reverted, confirmations, fee in ETH and USD, and every ERC-20 transfer decoded with symbols and amounts. Use to confirm a transfer, swap or payment landed.","x-price-usd":"0.002942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.002942"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"hash","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"description":"transaction hash"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","status":"success","confirmations":3820001,"fee":{"eth":4.1e-7,"usd":0.00104},"tokenTransfers":[{"symbol":"USDC","from":"0x4c29...","to":"0x36c3...","amount":"0.01"}]}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/x402/receipt":{"get":{"summary":"Verify an x402 or USDC payment on-chain from its transaction hash","description":"Verify an x402 or USDC payment on-chain from its transaction hash: payer, recipient, amount and token, whether it was an EIP-3009 transferWithAuthorization (x402 exact scheme), the settling facilitator, confirmations, and optional match checks against an expected payTo and minimum amount. Use to prove a payment before delivering, or to audit receipts.","x-price-usd":"0.002942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.002942"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"hash","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$"},"description":"settlement transaction hash"},{"name":"payTo","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"description":"optional expected recipient"},{"name":"amount","in":"query","required":false,"schema":{"type":"string"},"description":"optional minimum expected amount in token units, e.g. 0.01"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"verified":true,"scheme":"EIP-3009 transferWithAuthorization (x402 exact)","payment":{"payer":"0x4c29...","payTo":"0x36c3...","amount":"0.01","symbol":"USDC"},"checks":{"payToMatches":true,"amountMatches":true},"confirmations":3820001}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/x402scan/register":{"post":{"summary":"Register your x402 origin on x402scan in one paid call, without SIWX code or a GitHub issue","description":"Register your x402 origin on x402scan in one paid call, without SIWX code or a GitHub issue. POST {\"origin\": \"https://your-api.example\"}; returns x402scan's own result (registered, failed, skipped, reasons). Charged only if at least one resource registers; failures return 4xx and are not charged.","x-price-usd":"0.009942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.009942"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string","description":"https origin of your x402 API, e.g. https://api.example.com"}},"required":["origin"]},"example":{"origin":"https://plainchain.appin60.com"}}}},"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"ok":true,"origin":"https://plainchain.appin60.com","x402scan":{"success":true,"registered":10,"failed":0,"skipped":0,"total":10,"source":"openapi"},"serverPage":"https://www.x402scan.com/server/..."}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/fortune":{"get":{"summary":"A crypto fortune cookie","description":"A crypto fortune cookie: one short line of on-chain wisdom, picked by the latest Base block hash so anyone can verify the draw. For agent greetings, daily posts, games and demos of x402 payments.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"fortune":"Simulate first. Sign second.","chain":"Base","block":36581662,"index":19,"of":32,"howPicked":"index = blockHash mod count"}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/fact":{"get":{"summary":"A random crypto history fact (Bitcoin genesis, Pizza Day, The Merge, EIP-1559, x402 and HTTP 402, USDC, Base...), picked by the latest Base block hash","description":"A random crypto history fact (Bitcoin genesis, Pizza Day, The Merge, EIP-1559, x402 and HTTP 402, USDC, Base...), picked by the latest Base block hash. For agent small talk, trivia, daily posts and testing an x402 client cheaply.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"fact":"On 22 May 2010 Laszlo Hanyecz paid 10,000 BTC for two pizzas...","chain":"Base","block":36581662,"index":1,"of":29}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/bazaar/search":{"get":{"summary":"Find x402 APIs that agents actually pay for","description":"Find x402 APIs that agents actually pay for: keyword search over the whole Coinbase x402 Bazaar (31,000+ paid endpoints), ranked by distinct paying wallets in the last 30 days. Filter by max price and network. Returns URL, method, price, 30-day payers and calls, last paid call. Use to pick a proven seller before spending.","x-price-usd":"0.001942","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001942"},"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"},"description":"words describing the task, e.g. 'web search', 'token price', 'weather'"},{"name":"max_price","in":"query","required":false,"schema":{"type":"string"},"description":"optional max price per call in USD"},{"name":"network","in":"query","required":false,"schema":{"type":"string"},"description":"optional, e.g. base or eip155:8453"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"1-25, default 10"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"query":"gas price base","ranking":"distinct paying wallets in the last 30 days...","results":[{"resource":"https://api.example.com/gas","method":"GET","priceUsd":0.001,"payers30d":236,"calls30d":236,"lastCalledAt":"2026-10-13T06:12:00.000Z"}],"snapshotAt":"2026-10-13T08:30:00Z"}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/bazaar/host":{"get":{"summary":"Is my x402 API in the Coinbase Bazaar? Give a hostname; get every Bazaar entry for it with price, 30-day distinct payers and calls, and last paid call, or a hint on why it is missing","description":"Is my x402 API in the Coinbase Bazaar? Give a hostname; get every Bazaar entry for it with price, 30-day distinct payers and calls, and last paid call, or a hint on why it is missing. For x402 sellers checking discovery without crawling 31,000 listings.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"host","in":"query","required":true,"schema":{"type":"string"},"description":"hostname, e.g. api.example.com"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"host":"api.onesource.io","inBazaar":true,"resources":70,"maxPayers30d":560,"totalCalls30d":12298,"items":[{"resource":"https://api.onesource.io/api/chain/erc20-balance","priceUsd":0.003,"payers30d":560}]}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/x402/echo":{"get":{"summary":"Debug your x402 client on Base mainnet for $0.001","description":"Debug your x402 client on Base mainnet for $0.001: returns the payment payload your client actually signed and sent, decoded: version, header used, scheme, amount, validity window, and whether it echoed extensions.bazaar (needed for Bazaar cataloging) and resource/accepted.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"payer":"0x...","x402Version":2,"scheme":"exact","network":"eip155:8453","amountAuthorized":"1042","extensionsEchoed":["bazaar"],"checks":{"bazaarExtensionEchoed":true,"headerName":"PAYMENT-SIGNATURE (v2)"},"advice":[]}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}},"/v1/random":{"get":{"summary":"Verifiable random coin flip, dice roll and integer from the latest Base block hash (optionally salted), with the formula to recompute it","description":"Verifiable random coin flip, dice roll and integer from the latest Base block hash (optionally salted), with the formula to recompute it. Use for fair picks, giveaways, tie-breaks and games where anyone must be able to check the result.","x-price-usd":"0.001042","x-payment-info":{"protocols":["x402"],"pricingMode":"fixed","price":"0.001042"},"parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string"},"description":"base (default), arbitrum, ethereum or optimism; chain ids 8453, 42161, 1, 10 also work"},{"name":"sides","in":"query","required":false,"schema":{"type":"string"},"description":"dice sides, 2-1000 (default 6)"},{"name":"max","in":"query","required":false,"schema":{"type":"string"},"description":"integer range 1..max (default 100)"},{"name":"salt","in":"query","required":false,"schema":{"type":"string"},"description":"optional salt, e.g. a raffle id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chain":"Base","block":36581662,"blockHash":"0x9c1e...","coin":"heads","dice":4,"sides":6,"int":57,"max":100}}}},"400":{"description":"Bad input, not charged"},"402":{"description":"Payment required (x402, USDC on Base)"}}}}}}