Docs

Qué corre dónde, y qué viene después.

Cómo funciona swapfile.io

El convertidor y el limpiador de metadatos funcionan por completo en tu navegador usando la File API y canvas. Tu archivo se lee en la memoria de tu dispositivo, se procesa ahí y se descarga desde ahí. Para los formatos que un navegador no puede decodificar (como HEIC fuera de Safari) llegará un flujo en servidor; esos trabajos se eliminarán del almacenamiento en menos de una hora.

Flujo de datos

herramientas localesarchivo → tu navegador → tu carpeta de descargas
herramientas en servidor (pronto)archivo → subida prefirmada → worker → enlace de descarga → autoeliminación ≤ 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.

Compruébalo tú mismo

Abre las herramientas de desarrollo de tu navegador, observa la pestaña de red y convierte un archivo. Verás que ninguna solicitud lleva tu archivo.