{"uid":"cap_JX0j7pgDFHsmkqf0wW9jt","slug":"blockrun-ai-25fc4f9e","name":"BlockRun.AI Raw SQL Onchain Query","description":"Pay for the outcome. One endpoint for every model, tool and data source an agent needs — each call priced before it runs, at the best value per dollar. 103 models and 100 data and tool APIs.","url":"https://blockrun.ai/api/v1/surf/onchain/sql","method":"POST","headers":{},"bodySchema":null,"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0085","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0085","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2pnSs6jmcXWz_EVowPaOP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0085","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Execute arbitrary SQL queries against 80+ ClickHouse tables of onchain blockchain data with sub-second response times","exampleAgentPrompt":"Run this SQL query against BlockRun's onchain ClickHouse tables and return the results: SELECT chain, SUM(volume_usd) as total_volume FROM dex_trades WHERE block_time >= now() - INTERVAL 1 DAY GROUP BY chain ORDER BY total_volume DESC LIMIT 10","exampleUseCases":null,"resultDescription":"Returns the result set of the executed SQL query as rows of data from BlockRun's 80+ ClickHouse onchain blockchain tables, including column names and values matching the query projection.","failureModes":["Invalid SQL syntax returns a parse error response","Querying a non-existent table returns a table-not-found error","Query timeout if the SQL is too complex or scans too much data","Missing or invalid payment header causes 402 Payment Required","Unsupported SQL features or functions not available in ClickHouse return errors","Rate limiting if too many requests are sent in a short period"],"whenToPreferThis":"Use this endpoint when you need maximum flexibility to query onchain blockchain data with arbitrary SQL — joins, aggregations, filters, window functions — across 80+ ClickHouse tables. Prefer this over pre-built endpoints when no canned endpoint covers your specific analytic need, or when you want to combine multiple data dimensions in a single query with sub-second latency.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:50:46.631Z","isFirstParty":false}