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/apiAuthentication
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
| Method | Endpoint | Auth |
|---|---|---|
| GET | /health | No |
| GET | /api | No |
| POST | /api/image/meta | Yes |
| POST | /api/image/url-fetch | Yes |
| POST | /api/image/resize | Yes |
| POST | /api/image/resize-batch | Yes |
| POST | /api/image/crop | Yes |
| GET | /api/image/download/:fileId | Yes |
| GET | /api/history | Yes |
| POST | /api/contact | No |
| GET | /api/admin/storage | Yes |
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" }