Onchain SQL schema
GET /api/onchain-sql-schemaThe table + column schema for the onchain-sql tool - every queryable table (base.events, base.transactions, base.blocks, base.decoded_user_operations, base.transaction_attributions, solana.instructions, …) with its columns and types. Fetch once, then write SQL with confidence.
Input
No parameters.
Example output
{
"schema": {
"base.events": [
{
"name": "block_number",
"type": "UInt64"
}
]
}
}
Try it - see the 402 challenge (free)
curl -i "https://agent402.tools/api/onchain-sql-schema"
The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/onchain-sql-schema");
Part of these workflows
This tool is one step in a curated multi-tool workflow - agents can fetch the whole sequence as an MCP prompt or call https://agent402.tools/api/skill-packs/{slug}/prompt.
- Onchain analyst (SQL over Base) - Ask Base anything in one paid call: your SQL runs against Coinbase's indexed, DECODED chain data (events with parsed parameters, transactions, blocks, user-ops) with the live schema alongside - no indexer, no RPC archaeology.
Related tools
Wallet token balances (indexed)
GET /api/wallet-balancesAll token balances for any address in one call, from Coinbase's indexed data API - ERC-20 + native on EVM, SPL on Solana…
try in playground →Testnet faucet (try x402 free)
POST /api/testnet-fundFund any address with testnet money via the Coinbase faucet - USDC (1) or ETH (0.0001) on Base Sepolia, USDC (1) or SOL …
try in playground →Onramp link (fund a wallet with a card)
POST /api/onramp-linkGenerate a single-use Coinbase Onramp URL that lets a human fund any wallet with a card or Apple Pay - the fastest way t…
try in playground →