Public API v1.0

Real Image Resizer API

Server-side image processing for all formats and units. Use these endpoints to resize, crop, convert, and batch-process images programmatically.

Overview

The API is served from the backend at /api. All image processing happens server-side using Sharp for decoding, scaling, and encoding. Uploaded images are held in memory, uploaded to R2, and automatically deleted the moment the user downloads the result.

Base URL: http://localhost:5000/api

Authentication

Authenticated endpoints validate the Better Auth session from the Authorization: Bearer <session-token> header or the session cookie. Requests without a valid session are rejected with 401 Unauthorized.

Authorization: Bearer <session-token>

Endpoints

MethodEndpointAuth
GET/healthNo
GET/apiNo
POST/api/image/metaYes
POST/api/image/url-fetchYes
POST/api/image/resizeYes
POST/api/image/resize-batchYes
POST/api/image/cropYes
GET/api/image/download/:fileIdYes
GET/api/historyYes
POST/api/contactNo
GET/api/admin/storageYes

Units & Formats

Supported Units

  • px — pixels
  • % — percent of original
  • in — inches (DPI-aware)
  • cm — centimeters (DPI-aware)
  • mm — millimeters (DPI-aware)

Supported Formats

  • jpeg / jpg
  • png
  • gif
  • webp
  • heic (decoded via HEIC → JPEG pipeline)

Errors

Errors are returned as JSON with an error field:

{ "error": "Image resizing failed" }