{"uid":"cap_H123ynt8f-cQUOe1puEmM","slug":"citiview-sql-query-engine-203144c2","name":"Citiview SQL Query Engine","description":"Run SQL on your data: load JSON rows or CSV (or several named tables) into SQLite and run any SELECT, including GROUP BY, JOIN, window functions and CTEs. Up to 100,000 rows. Also callable as GET with the same fields as query parameters.","url":"https://agents.citiviewgroup.com/v1/sql?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["query"],"properties":{"data":{"type":"string","description":"JSON array or CSV text (table name: data)"},"query":{"type":"string","description":"SELECT ..."},"tables":{"type":"string","description":"JSON object {name: rows} for several tables"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_feptkHL6W8bTeFNFbT2XS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs arbitrary SQL SELECT queries against user-supplied JSON or CSV data loaded into an in-memory SQLite instance, supporting JOINs, GROUP BY, window functions, and CTEs across up to 100,000 rows.","exampleAgentPrompt":"I have a JSON array of sales records and I want to find the top 5 products by total revenue — can you run a GROUP BY query on it and return the results?","exampleUseCases":[{"title":"Aggregate sales data from JSON","prompt":"Here's a JSON array of 5,000 order records with columns 'product', 'region', and 'amount' — can you run a SQL query to get total revenue and order count grouped by product and region?"},{"title":"Join two CSV tables on a key","prompt":"I have two JSON tables: 'users' with user_id and name, and 'purchases' with user_id and item. Can you JOIN them on user_id and return each user's full name alongside what they bought?"},{"title":"Compute rolling average with window function","prompt":"I've got a CSV of daily stock prices with columns 'date' and 'close' — can you write a SQL window function to compute a 7-day rolling average of the closing price for each row?"}],"resultDescription":"An array of result rows returned by the SELECT query, shaped according to the columns and expressions in the query — could include aggregated counts, sums, joined fields, window function values, or any computed output SQLite supports.","failureModes":["Invalid SQL syntax returns a parse or execution error from SQLite","Data exceeding 100,000 rows may be rejected or truncated","Malformed JSON array or CSV input causes a parsing failure","Non-SELECT statements (INSERT, UPDATE, DROP) are likely rejected","Referencing a table name not present in the supplied data returns a 'no such table' error","Network or payment (x402) failure returns a 402 or connection error"],"whenToPreferThis":"Choose this endpoint when you have structured data in JSON or CSV format and need to run ad-hoc SQL analytics — aggregations, joins, filtering, window functions — without standing up a database. Ideal for one-off data questions on datasets up to 100,000 rows where the query logic is best expressed in SQL rather than code. Prefer over a general LLM for precise, deterministic tabular computation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-14T06:48:17.407Z","isFirstParty":false,"canonicalSlug":"citiview-sql-query-engine-203144c2"}