API Reference

One endpoint. Send CSV data and plain-English instructions. Get structured analysis back.

POST /v1/analyze

Upload a CSV file with natural language instructions. CrunchAPI generates analysis code, executes it in a sandbox, self-heals on errors (up to 3 retries), and returns structured results with a human-readable summary.

Request (multipart/form-data)
Field Type Description
csv required file CSV file to analyze (max 10MB)
instructions required string Natural language description of the analysis to perform
Example Request (cURL)
curl -X POST https://crunchapi-ndpj.polsia.app/v1/analyze \ -F csv=@sales_q4.csv \ -F instructions="Find the top 3 products by revenue growth rate. Show month-over-month trends."
Example Request (Python)
import requests response = requests.post( "https://crunchapi-ndpj.polsia.app/v1/analyze", files={"csv": open("sales_q4.csv", "rb")}, data={"instructions": "Find top 3 products by revenue"} ) print(response.json())
Example Request (JavaScript)
const form = new FormData(); form.append('csv', fileInput.files[0]); form.append('instructions', 'Find top 3 products by revenue'); const res = await fetch('/v1/analyze', { method: 'POST', body: form }); const data = await res.json();
Response
Field Type Description
summary string Natural language summary of the analysis findings
results object|array Structured analysis data
code_executed string The analysis code that was generated and executed
retries number Number of self-healing retries (0 = first attempt succeeded)
metadata object Request metadata (rows_analyzed, columns, duration_seconds)
Example Response
{ "summary": "Widget Pro led Q4 with 34% MoM revenue growth. CloudSync and DataPack followed at 28% and 21%. Anomaly: Widget Pro spiked 180% in November.", "results": { "top_products": [ { "product": "Widget Pro", "growth_rate": 0.34, "total_revenue": 82500 }, { "product": "CloudSync", "growth_rate": 0.28, "total_revenue": 59800 } ] }, "code_executed": "const grouped = data.reduce(...);\nresult = { top_products: ... };", "retries": 0, "metadata": { "rows_analyzed": 1847, "columns": ["product", "month", "revenue"], "duration_seconds": 2.3 } }

Try It Now

Upload a CSV and describe what you want to know. No API key needed for the playground.

Processing...
Sending request...
Error Responses
Status Meaning When
200 Success Analysis completed
400 Bad Request Missing CSV, bad format, or missing instructions
500 Analysis Failed Code generation/execution failed after all retries