Skip to content
Utilerio
All endpoints

SQL Formatter

POST/api/v1/sql-format

Format and beautify SQL queries for MySQL, PostgreSQL, SQLite and more.

Authentication

Requires an API key in the X-API-Key header.

Try it

POST/api/v1/sql-format

Parameters

sqlstringrequired

SQL query to format.

languagestringoptional

SQL dialect (postgresql, mysql, …). Default sql.

Request body

{
  "sql": "select * from users where id=1",
  "language": "postgresql"
}

Response codes

  • 200Success.
  • 400Invalid request — check your body or parameters.
  • 401Missing or invalid API key.
  • 403The API key is not scoped to this endpoint.
  • 429Rate limit exceeded — retry after a short wait.

Language

cURL

Request

curl -X POST https://utilerio.com/api/v1/sql-format \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sql":"select * from users where id=1","language":"postgresql"}'

Response

{ "formatted": "SELECT\n  *\nFROM\n  users" }