/api/convert Datei konvertieren
Konvertiert eine Datei in ein anderes Format. Unterstützt Video, Audio, Bilder und Dokumente.
Parameter
| Name | Typ | Beschreibung |
|---|---|---|
file required | File | Die zu konvertierende Datei (multipart/form-data) |
target_format required | string | Zielformat (z.B. "mp4", "pdf", "png") |
processing_mode | string | "auto" | "force_cpu" | "force_gpu" |
Beispiele
cURL
curl -X POST "https://loadsh.it/api/convert" \
-H "Authorization: Bearer lsh_live_xxxx" \
-F "[email protected]" \
-F "target_format=mp4" JavaScript
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('target_format', 'mp4');
const response = await fetch(
'https://loadsh.it/api/convert',
{
method: 'POST',
headers: { 'Authorization': 'Bearer lsh_live_xxxx' },
body: formData
}
);
const data = await response.json(); Response
{
"success": true,
"job_id": "conv_abc123",
"status": "processing"
}