Convert CSV and JSON to production-ready Postgres SQL. One API call. Auto-detects types. Zero config.
# Convert CSV to Postgres SQL in one call curl -X POST https://api.sheetsql.dev/v1/convert \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"data": "name,age\nAlice,30\nBob,25", "tableName": "users"}' # Response: { "ddl": "CREATE TABLE public.users (\n id bigint GENERATED ...\n);", "inserts": "INSERT INTO public.users ...", "columns": [{ "pgType": "text", ... }] }
Auto-detects uuid, integer, numeric, boolean, timestamp, jsonb, and more from your data.
CREATE TABLE DDL, batched INSERT statements, and COPY from stdin - all optimized for Postgres.
Format messy SQL and detect common issues like UPDATE without WHERE, SELECT *, bad pagination.
Just send your data. We handle delimiter detection, type inference, reserved word escaping, everything.
Start free. Upgrade when you need more.
Enter your email to get a free API key instantly. No credit card required.
Paste CSV or JSON data below and see the generated SQL instantly. No API key needed.
# POST /v1/convert - Convert CSV/JSON to SQL { "data": "your CSV or JSON string", "tableName": "users", // optional, default: imported_data "schema": "public", // optional "addId": true, // optional, auto-increment id "includeIndexes": true // optional, suggest indexes } # POST /v1/format - Format SQL { "sql": "select * from users where id=1" } # POST /v1/analyze - Format + find issues { "sql": "delete from users" } # GET /v1/usage - Check your usage