Code API
Minifiziere, formatiere und konvertiere JavaScript, CSS, HTML, SVG, JSON, XML und Dutzende Sprachpaare – über eine saubere JSON-REST-Schnittstelle.
Text rein → Text raus. Schick ein Snippet per JSON und erhalte es minifiziert, formatiert oder konvertiert zurück. Dahinter steckt dieselbe Node-Toolchain (Terser, clean-css, html-minifier-terser, prettier, svgo) wie bei unseren Web-Tools – die Ausgabe ist also exakt gleich.
# Minify a JavaScript snippet
curl -X POST https://jinero.online/api/v1/code/minify \
-H "Content-Type: application/json" \
-d '{"code": "function add(a, b) { return a + b; }", "type": "js"}'
const r = await fetch("https://jinero.online/api/v1/code/minify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ code: source, type: "js", mode: "minify" }),
});
const { output, savings_percent } = await r.json();
Alle Endpunkte sind öffentlich – kein API-Schlüssel nötig. Die Operationen sind reine Texttransformationen (keine GPU, keine Bildverarbeitung), daher sind die Limits höher als bei der Images API.
# Anonymous limits (per IP):
# POST /code/minify 30 req/min
# POST /code/detect 30 req/min
# POST /code/convert 30 req/min
# GET /code/converters 30 req/min
# Max snippet size: 200,000 chars (~200 KB)
Komprimiere ein Snippet oder formatiere es lesbar. Derselbe Endpunkt beherrscht über den Parameter mode beide Richtungen – praktisch, wenn du JSON-Konfigurationsdateien oder einzeilig minifiziertes CSS lesen willst.
https://jinero.online/api/v1/code/minify
| Parameter | Typ | Beschreibung |
|---|---|---|
code |
string | Quellcode. Max. 200.000 Zeichen. |
type |
string | Einer der Werte: js, css, html, svg, json, xml, auto. Mit "auto" erkennt der Server den Inhalt selbst. |
mode |
string | minify (Standard) oder beautify. |
keep_license |
boolean | Lizenzkommentare /*! ... */ beim Minifizieren beibehalten. Standard: true. |
curl -X POST https://jinero.online/api/v1/code/minify \
-H "Content-Type: application/json" \
-d @- <<JSON
{
"code": ".btn { color: red; padding: 8px 12px; }",
"type": "css",
"mode": "minify"
}
JSON
const r = await fetch("https://jinero.online/api/v1/code/minify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
code: cssSource,
type: "css",
mode: "minify",
keep_license: true,
}),
});
const data = await r.json();
$response = Http::post("https://jinero.online/api/v1/code/minify", [
"code" => $jsSource,
"type" => "js",
"mode" => "minify",
]);
$minified = $response->json("output");
{
"success": true,
"type": "css",
"mode": "minify",
"output": ".btn{color:red;padding:8px 12px}",
"original_size": 46,
"output_size": 27,
"savings_percent": 41.3,
"line_count": 1
}
Erkennt automatisch die Sprache eines Snippets. Liefert den ermittelten Typ und die Liste der Konverter-Ziele, die ihn als Eingabe akzeptieren – praktisch für „Konvertieren in…“-Dropdowns.
https://jinero.online/api/v1/code/detect
| Parameter | Typ | Beschreibung |
|---|---|---|
code |
string | Quellcode. Max. 200.000 Zeichen. |
curl -X POST https://jinero.online/api/v1/code/detect \
-H "Content-Type: application/json" \
-d '{"code": "{\"name\": \"jinero\"}"}'
const r = await fetch("https://jinero.online/api/v1/code/detect", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ code: snippet }),
});
const { detected_type, available_targets } = await r.json();
{
"success": true,
"detected_type": "json",
"confidence": 0.97,
"available_targets": ["yaml", "toml", "xml", "csv"]
}
Zeigt jede unterstützte Konvertierung (from → to) samt Optionsschema pro Paar. Damit baust du Oberflächen, die sich automatisch anpassen, wenn wir neue Konverter hinzufügen.
https://jinero.online/api/v1/code/converters
curl https://jinero.online/api/v1/code/converters
const r = await fetch("https://jinero.online/api/v1/code/converters");
const { converters } = await r.json();
// converters is a flat list of { id, from, to, label, optionsSchema }
{
"success": true,
"converters": [
{ "id": "json-to-yaml", "from": "json", "to": "yaml", "label": "JSON → YAML", "optionsSchema": {} },
{ "id": "css-to-scss", "from": "css", "to": "scss", "label": "CSS → SCSS", "optionsSchema": {} },
{ "id": "html-to-pug", "from": "html", "to": "pug", "label": "HTML → Pug", "optionsSchema": {} }
]
}
Konvertiert ein Snippet von einer Sprache in eine andere. Unterstützt JSON↔YAML↔TOML↔XML, CSS↔SCSS, HTML↔Pug, SVG↔JSX und mehr – die vollständige Liste liefert /code/converters.
https://jinero.online/api/v1/code/convert
| Parameter | Typ | Beschreibung |
|---|---|---|
code |
string | Quellcode. Max. 200.000 Zeichen. |
from |
string | Kennung der Ausgangssprache aus /code/converters. |
to |
string | Kennung der Zielsprache. |
options |
object | Konverterspezifische Einstellungen (siehe optionsSchema in /code/converters). |
curl -X POST https://jinero.online/api/v1/code/convert \
-H "Content-Type: application/json" \
-d '{"code": "{\"name\": \"jinero\"}", "from": "json", "to": "yaml"}'
const r = await fetch("https://jinero.online/api/v1/code/convert", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
code: jsonSource,
from: "json",
to: "yaml",
}),
});
const { output } = await r.json();
$res = Http::post("https://jinero.online/api/v1/code/convert", [
"code" => $cssSource,
"from" => "css",
"to" => "scss",
]);
$scss = $res->json("output");
{
"success": true,
"from": "json",
"to": "yaml",
"output": "name: jinero\n",
"notes": null
}
Standard-HTTP-Semantik. Fehler liefern JSON mit dem Feld "message", das den Fehler beschreibt.
// 422 — validation (unknown type, oversize snippet, unsupported converter)
{ "message": "The type field must be one of: js, css, html, svg, json, xml, auto." }
// 422 — minification/conversion error from the underlying tool
{ "message": "Unexpected token at line 12" }
// 429 — rate limit exceeded
{ "message": "Too Many Attempts." }
// 500 — registry unreachable (Node helper crashed)
{ "message": "Registry unavailable" }
Über die Code API von jinero.online
Kostenlose REST-API zum Minifizieren, Formatieren und Konvertieren von Quellcode – JS, CSS, HTML, SVG, JSON, YAML, TOML, XML, Pug, SCSS – über eine einzige saubere JSON-Schnittstelle.
Bewährte Tools
Terser, clean-css, html-minifier-terser, prettier, svgo – dieselben Engines wie überall, bereitgestellt über eine saubere REST-Schnittstelle.
Konvertierungsmatrix
20+ Sprachpaare: JSON↔YAML↔TOML↔XML, CSS↔SCSS, HTML↔Pug, SVG↔JSX. Alle findest du unter /code/converters.
Hohe Rate-Limits
30 Anfragen/Minute pro IP – Text rein, Text raus, keine Dateispeicherung, um die du dich kümmern musst.
Zustandslos & privat
Snippets werden im Arbeitsspeicher verarbeitet und nie geloggt. Hinterher gibt es nichts aufzuräumen.
Häufig gestellte Fragen
Nein. Die Code API ist öffentlich, das Rate-Limit gilt pro IP – 30 Anfragen/Minute pro Endpunkt. Wenn du höhere Limits brauchst, registriere dich und hol dir ein Token.
200.000 Zeichen (~200 KB) pro Anfrage. Das reicht selbst für sehr große gebündelte CSS- oder JSON-Konfigurationsdateien. Für riesige Minifizierungsjobs nutze Terser lokal.
Ja. Beide rufen dieselben Node-Hilfsskripte (resources/node/minify.js und resources/node/converter.js) mit denselben Flags auf, daher ist das Verhalten identisch.
Derzeit über zwanzig Paare: JSON↔YAML↔TOML↔XML, CSV↔JSON, CSS↔SCSS, HTML↔Pug, SVG↔JSX und weitere. Die aktuelle, maschinenlesbare Liste liefert GET /code/converters – inklusive Optionsschemas pro Paar.
Nein. Der Body der Anfrage wird für das Node-Hilfsskript in eine temporäre Datei geschrieben, verarbeitet und sofort gelöscht. Wir loggen keine Code-Inhalte – nur die Metadaten der Anfrage (Größe, Typ, Statuscode) für das Rate-Limiting.