Format any SQL into the Vitti "river" style over HTTP — the same engine as the web app and the browser extension. No key, CORS open, rate-limited (~20 req/s).
Base URL: https://identar.lucas.mat.br/api/format
curl -s -X POST https://identar.lucas.mat.br/api/format \
-H 'Content-Type: application/json' \
-d '{"sql":"select a, b from t where x = 1","options":{"useTabs":false}}'
Response:
{"formatted":"select a\n ,b\n\nfrom t\n\nwhere 1=1\nand x = 1\n"}
Options go nested underoptions. A flatuseTabsnext tosqlis ignored.
curl -s "https://identar.lucas.mat.br/api/format?sql=select%20a,b%20from%20t&useTabs=false&format=text"
On GET, options are flat query params, and format=text returns the raw SQL instead of JSON.
| key | values | note |
|---|---|---|
useTabs | true / false | false = spaces — use when pasting into Databricks |
keywordCase | lower / upper / preserve | |
tabWidth / riverWidth | integer | indent size / operand column (default 12) |
aliasColumn / joinColumn / filterColumn | integer (0 = auto/off) | the alignment rulers |
where11 | true / false | open every where with 1=1 |
• Response: {"formatted": "…"} (JSON), or raw SQL when format=text.
• Health: GET /api/health → {"ok":true}.
• Errors: {"error":"bad_json",…} with HTTP 400 for malformed input.
• Open, no auth, rate-limited — fine to call from a notebook or a script.
import requests
r = requests.post("https://identar.lucas.mat.br/api/format",
json={"sql": "select a, b from t", "options": {"useTabs": False}})
print(r.json()["formatted"])
Formata qualquer SQL no estilo "rio" do Vitti via HTTP — o mesmo motor do site e da extensão de navegador. Sem chave, CORS aberto, com limite de taxa (~20 req/s). URL base: https://identar.lucas.mat.br/api/format
curl -s -X POST https://identar.lucas.mat.br/api/format \
-H 'Content-Type: application/json' \
-d '{"sql":"select a, b from t where x = 1","options":{"useTabs":false}}'
Retorna:
{"formatted":"select a\n ,b\n\nfrom t\n\nwhere 1=1\nand x = 1\n"}
As opções vão aninhadas emoptions. UmuseTabssolto ao lado desqlé ignorado.
curl -s "https://identar.lucas.mat.br/api/format?sql=select%20a,b%20from%20t&useTabs=false&format=text"
No GET, as opções são parâmetros de query, e format=text devolve o SQL puro em vez de JSON.
| chave | valores | observação |
|---|---|---|
useTabs | true / false | false = espaços — use ao colar no Databricks |
keywordCase | lower / upper / preserve | |
tabWidth / riverWidth | inteiro | tamanho do recuo / coluna do operando (padrão 12) |
aliasColumn / joinColumn / filterColumn | inteiro (0 = auto/desliga) | as réguas de alinhamento |
where11 | true / false | abre todo where com 1=1 |
• Resposta: {"formatted": "…"} (JSON), ou SQL puro quando format=text.
• Health: GET /api/health → {"ok":true}.
• Erros: {"error":"bad_json",…} com HTTP 400 para entrada malformada.
• Aberto, sem autenticação, com limite de taxa — ok para chamar de um notebook ou script.
import requests
r = requests.post("https://identar.lucas.mat.br/api/format",
json={"sql": "select a, b from t", "options": {"useTabs": False}})
print(r.json()["formatted"])
Raw markdown: api.md · Formatting rules: the rules ↗