Run read-only SQL against indexed, DECODED blockchain data
agent402.tools/api/onchain-sql
Run read-only SQL against indexed, DECODED blockchain data - base.events (decoded logs with parameters), base.transactions, base.blocks, base.decoded_user_operations, base.transaction_attributions (builder codes), plus solana.instructions (filter it by block_time). ClickHouse-dialect SELECTs, server-side grammar validation, up to 1,000 rows per call (a larger result is cut at 1,000 and says so). A
POST
https://agent402.tools/api/onchain-sqlUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agent402.tools/api/onchain-sql", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"sql":"SELECT COUNT(*) AS txs FROM base.transactions WHERE block_number > 0 LIMIT 1"}),
});
console.log(await res.json());Example input
{
"sql": "SELECT COUNT(*) AS txs FROM base.transactions WHERE block_number > 0 LIMIT 1"
}Price changes
- Nov 25, 20260.03 → 0.02
