Docs

Was wo läuft und was als Nächstes kommt.

So funktioniert swapfile.io

Der Konverter und der Metadaten-Cleaner laufen komplett in deinem Browser, über die File API und Canvas. Deine Datei wird auf deinem Gerät in den Speicher gelesen, dort verarbeitet und von dort heruntergeladen. Für Formate, die ein Browser nicht dekodieren kann (wie HEIC außerhalb von Safari), kommt eine serverseitige Pipeline; diese Jobs werden innerhalb einer Stunde aus dem Speicher gelöscht.

Datenfluss

lokale ToolsDatei → dein Browser → dein Download-Ordner
Server-Tools (bald)Datei → presigned Upload → Worker → Download-Link → Auto-Löschung ≤ 1 h

API

Convert files from your own code with a REST API. It runs the same server pipeline as the site: you register an upload, send the bytes, start a conversion job, then download the result — all authenticated with an API key.

Create an API key in your account

Authentication

Every request carries your key in the Authorization header (Bearer), or an X-API-Key header. Treat it like a password — it spends your account's conversion quota.

https://api.swapfile.ioLive
curl https://api.swapfile.io/v1/jobs/{id} \
    -H "Authorization: Bearer sf_live_..."

Converting a file

heic → jpeg
# 1 · register the upload → presigned URL
curl -X POST https://api.swapfile.io/v1/uploads \
    -H "Authorization: Bearer sf_live_..." \
    -H "Content-Type: application/json" \
    -d '{"size": 48213}'
→ {"file_id":"9f2c…","upload_url":"https://…"}

# 2 · send the raw bytes to that URL
curl -X PUT --upload-file photo.heic "$UPLOAD_URL"

# 3 · start the conversion
curl -X POST https://api.swapfile.io/v1/jobs \
    -H "Authorization: Bearer sf_live_..." \
    -H "Content-Type: application/json" \
    -d '{"file_id":"9f2c…","operation":"convert:jpeg","params":{"quality":"82"}}'
→ 202 {"id":"7ab1…","status":"queued"}

# 4 · poll until done, then download
curl https://api.swapfile.io/v1/jobs/7ab1… \
    -H "Authorization: Bearer sf_live_..."
→ {"status":"done","download_url":"https://…"}

Endpoints

POST/v1/uploadsRegister an upload; returns a presigned PUT URL.
PUT{upload_url}Send the raw file bytes (max 100 MB).
POST/v1/jobsStart a conversion job for an uploaded file.
GET/v1/jobs/{id}Job status; includes download_url once done.
DELETE/v1/jobs/{id}Delete the file and job immediately.

Operations

Pass one of these as the operation. Accepted inputs include JPEG, PNG, WebP, GIF, BMP, HEIC, AVIF and TIFF.

convert:jpeg→ JPEG · params: quality (1–100)
convert:png→ PNG (lossless)
convert:webp→ WebP · params: quality (1–100)

Limits

  • 100 MB max upload
  • 30 conversions / day (free)
  • 60 requests / minute per key
  • Files auto-deleted within 1 hour

Errors

Failures return RFC 9457 problem+json with a stable code field — for example unauthorized, unsupported_format, file_too_large, quota_exceeded or rate_limited.

Prüf es selbst

Öffne die Entwicklertools deines Browsers, beobachte den Netzwerk-Tab und wandle eine Datei um. Du wirst keine Anfrage sehen, die deine Datei enthält.