SQL Formatter Transpiler Format Transpile Validate API
Free tier included · ToolsSQL Formatter & Transpiler processes SQL purely syntactically through sqlglot: it formats and pretty-prints SQL, transpiles between 20+ dialects (postgres, mysql, bigquery, snowflake, duckdb, tsql, sqlite, and more), extracts structural metadata (statements, tables, columns, CTEs), and statically validates syntax. It never executes queries, never stores input, and makes no external network calls — everything runs in-process and statelessly.
It adds two convenience endpoints on top of full-control formatting: `/format-simple` for one-call pretty-printing with sensible defaults, and `/validate` for fast syntax checking that returns `valid: true/false` with a list of issues when parsing fails. These are ideal for editor integrations, CI lint gates, and no-install automation.
Who needs it: backend developers embedding SQL formatting in apps without shipping a library; data engineers transpiling queries across warehouse dialects in ETL pipelines; analytics engineers linting dbt models or notebooks; DBAs auditing SQL style across codebases.
Honest limits: the parser is permissive — some malformed inputs without a FROM clause may parse as aliases rather than errors. Transpile warnings (e.g., unsupported features) are surfaced in the response. Input SQL is capped at 1,048,576 characters per request. Concurrency is bounded server-side. Responses are structured JSON; errors use codes like 400 (empty input), 413 (too large), and 422 (invalid input).
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | API metadata: name, version, and paths to the interactive docs and health endpoint. |
GET | /health | Liveness probe; returns status "ok" while the process is up. |
POST | /format | Format and optionally pretty-print SQL for a given dialect. sql is required; dialect and reindent are optional. |
POST | /transpile | Transpile SQL from one dialect to another. sql, from, and to are all required. |
POST | /parse-stats | Extract structural metadata from SQL: statements, tables, columns, and CTEs. sql is required; dialect is optional. |
POST | /format-simple | Fast SQL formatting with sensible defaults (pretty-printed, generic dialect). Single required field: sql. |
POST | /validate | Statically validate SQL syntax for a given dialect. sql is required; dialect is optional. Returns valid: true when the SQL parses cleanly, otherwise valid: false with a list of issues. |
Quick start
curl -X POST "https://sqlfmt.p.rapidapi.com/format" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: sqlfmt.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{"sql": "select a, b from t where x = 1", "dialect": "postgres", "reindent": true}'
FAQ
Does this API execute SQL or connect to any database?
No. It performs purely syntactic processing via sqlglot — formatting, transpiling, parsing, and validation only. No queries are executed and no databases are contacted.
Is my SQL stored or logged?
No. The API is stateless and offline. Input SQL is processed in-memory and never persisted or logged.
How many dialects does transpilation support?
20+ dialects including postgres, mysql, bigquery, snowflake, duckdb, tsql, sqlite, redshift, spark, hive, oracle, and more. See the `dialect` enum in the OpenAPI spec.
What is the difference between /format and /format-simple?
`/format` gives full control over dialect and reindent options. `/format-simple` uses sensible defaults (pretty-printed, generic dialect) for quick one-call formatting when you don't need dialect-specific behavior.
Try SQL Formatter Transpiler Format Transpile Validate free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI