{"openapi":"3.1.0","info":{"title":"BaseLens","version":"1.1.0","description":"Pay-per-call Base on-chain reads over x402 (USDC on Base).","contact":{"name":"BaseLens","email":"alphaops@mail.grokbot.com"}},"servers":[{"url":"https://baselens-api.vercel.app"}],"paths":{"/v1/address":{"get":{"summary":"Base (chain 8453) address snapshot: EOA vs contract vs EIP-7702, ETH balance, nonce, code size and native USDC balance, at the latest block.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"},"description":"0x-prefixed Base address"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"chainId":8453,"block":37000000,"address":"0x8335…2913","type":"contract","ethBalance":"0","nonce":1,"usdcBalance":"12.5"}}}},"402":{"description":"Payment required: $0.002 USDC on Base (x402)"}},"x-x402":{"price":"$0.002","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/erc20-balance":{"get":{"summary":"ERC-20 balance of any address for any token on Base, with symbol and decimals already applied (raw and human-readable).","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"ERC-20 token contract on Base"},{"name":"address","in":"query","required":true,"schema":{"type":"string"},"description":"0x-prefixed Base address"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"token":"0x8335…2913","symbol":"USDC","decimals":6,"balanceRaw":"1000000","balance":"1"}}}},"402":{"description":"Payment required: $0.002 USDC on Base (x402)"}},"x-x402":{"price":"$0.002","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/token":{"get":{"summary":"Token facts on Base: name, symbol, decimals, total supply, contract code size, owner() and EIP-1967 proxy implementation, plus plain-language notes (upgradeable? owner renounced?). Read-only facts, not advice.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"Token contract on Base"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"token":"0x8335…2913","name":"USD Coin","symbol":"USDC","decimals":6,"totalSupply":"4000000000","proxyImplementation":"0x…","notes":["Upgradeable proxy…"]}}}},"402":{"description":"Payment required: $0.003 USDC on Base (x402)"}},"x-x402":{"price":"$0.003","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/tx":{"get":{"summary":"Human-readable summary of a Base transaction: status, block time, from/to, value, total fee (incl. L1 fee), and decoded ERC-20 Transfer events with token symbols and amounts. Handy to verify a payment landed.","parameters":[{"name":"hash","in":"query","required":true,"schema":{"type":"string"},"description":"0x-prefixed transaction hash on Base"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"status":"success","blockNumber":37000000,"timestamp":"2026-10-30T04:33:00.000Z","feeEth":"0.0000012","erc20Transfers":[{"symbol":"USDC","amount":"1","to":"0x4bF3…e4aa"}]}}}},"402":{"description":"Payment required: $0.003 USDC on Base (x402)"}},"x-x402":{"price":"$0.003","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/gas":{"get":{"summary":"Current Base gas: base fee, gas price, suggested EIP-1559 max fee and priority fee (gwei), block fullness, and cost of a plain ETH transfer.","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"block":37000000,"baseFeeGwei":"0.005","maxFeePerGasGwei":"0.011","simpleTransferCostEth":"0.0000001"}}}},"402":{"description":"Payment required: $0.001 USDC on Base (x402)"}},"x-x402":{"price":"$0.001","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/name":{"get":{"summary":"Resolve a Basename (name.base.eth) or ENS name to its Base/Ethereum address, or reverse-resolve an address to its primary ENS/Basename. Includes avatar record.","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string"},"description":"ENS or Basename, e.g. jesse.base.eth or vitalik.eth"},{"name":"address","in":"query","required":false,"schema":{"type":"string"},"description":"Alternative: 0x address to reverse-resolve"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"query":"jesse.base.eth","type":"forward","address":"0x2211d1D0020DAEA8039E46Cf1367962070d77DA9","baseAddress":"0x2211…7DA9","avatar":"https://…","resolved":true}}}},"402":{"description":"Payment required: $0.001 USDC on Base (x402)"}},"x-x402":{"price":"$0.001","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/price":{"get":{"summary":"On-chain USDC price of any Base ERC-20: executable Uniswap v3 quote for 1 whole token (direct USDC pool or via WETH, best fee tier). No third-party price API.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"ERC-20 token contract on Base"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"token":"0x4200…0006","symbol":"WETH","priceUsdc":"2213.75","route":"uniswap-v3 WETH→USDC fee 500","priced":true}}}},"402":{"description":"Payment required: $0.003 USDC on Base (x402)"}},"x-x402":{"price":"$0.003","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/transfers":{"get":{"summary":"Recent ERC-20 transfers in and out of an address on Base for up to 5 tokens (default USDC), newest first, over the last ~10k blocks (max 30k). Check incoming payments or wallet activity.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"},"description":"0x-prefixed Base address"},{"name":"tokens","in":"query","required":false,"schema":{"type":"string"},"description":"Optional comma-separated token contracts (max 5). Default USDC."},{"name":"blocks","in":"query","required":false,"schema":{"type":"string"},"description":"Lookback in blocks, 100–30000 (default 10000)"},{"name":"limit","in":"query","required":false,"schema":{"type":"string"},"description":"Max transfers to return, ≤200 (default 50)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"address":"0x4B5c…34F6","totalFound":12,"returned":5,"transfers":[{"block":53290131,"tx":"0x…","direction":"out","symbol":"USDC","amount":"23","to":"0xB706…82a3"}]}}}},"402":{"description":"Payment required: $0.004 USDC on Base (x402)"}},"x-x402":{"price":"$0.004","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}},"/v1/contract":{"get":{"summary":"Contract check on Base: is it a contract, code size, owner(), proxy implementation, and whether the source (and implementation) is verified on Sourcify, plus plain-language notes. Not an audit.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"},"description":"0x-prefixed Base address"}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"isContract":true,"owner":"0x3ABd…6df7","proxyImplementation":"0x2Ce6…D779","sourcify":{"verified":true,"match":"exact_match","name":"FiatTokenProxy"},"notes":["Upgradeable proxy…"]}}}},"402":{"description":"Payment required: $0.003 USDC on Base (x402)"}},"x-x402":{"price":"$0.003","network":"eip155:8453","payTo":"0x50F806C7E473322484bc91FF628380a3b12366f9"}}}}}