API Documentation

Integrate TinyJPG.co into your workflow with our REST API.

Base URL

https://your-domain.com

All API endpoints return JSON responses with a success boolean field.

Authentication

Protected endpoints require authentication via HTTP-only cookie. Log in via /api/auth/login to receive the auth cookie automatically.

Endpoints

GET/api/stats

Get site-wide processing statistics

Response

{ success: true, data: { totalProcessed, todayProcessed, avgTime } }
GET/api/history

Get recent processing history records

Response

{ success: true, data: [{ id, file_name, width, height, ... }] }
POST/api/history

Record an image processing event

Request Body

{ fileName, fileSize, width, height, watermarkSize, processingTimeMs }

Response

{ success: true, id: 123 }
POST/api/auth/register

Register a new user account

Request Body

{ name, email, password }

Response

{ success: true, data: { id, name, email, role } }
POST/api/auth/login

Log in to an existing account

Request Body

{ email, password }

Response

{ success: true, data: { id, name, email, role } }
GET/api/auth/me

Get current authenticated user info

Response

{ success: true, data: { id, name, email, role } }
POST/api/feedback

Submit a feedback/contact message

Request Body

{ name, email, message }

Response

{ success: true }
GET/api/blog

Get published blog posts

Response

{ success: true, data: [{ id, title, slug, excerpt, ... }] }

Note on Image Processing

The actual watermark removal happens entirely in the browser using the Canvas API and our JavaScript engine. The API endpoints are for tracking, history, and user management — not for server-side image processing. To integrate watermark removal into your app, use the WatermarkEngine class from the client-side library.