API Documentation
Integrate fast image uploading, URL fetching, automated compression, and format conversion directly into your applications, mobile apps, and scripts.
Getting Started
Endpoints
Overview
The ImgUploadz REST API allows developers to programmatically upload images from local storage or remote URLs, apply transformations (resize, rotate, format conversion, compression, watermarking), and receive permanent hosting URLs and responsive thumbnails.
https://imguploadz.com/api Authentication
All API requests require authentication. You must supply your account API token in the HTTP request headers using the token header.
token: YOUR_API_TOKEN Rate Limits & File Sizes
POST /api/upload
multipart/form-dataUpload a binary image file directly from your local filesystem or application memory. Supports automatic WebP conversion, custom compression, dimension resizing, password protection, and auto-removal.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file | File | Required | Binary image file. Supported: JPG, JPEG, PNG, WEBP, GIF, SVG, BMP, ICO (Max 5MB). |
type | String | Optional | Convert image to target format: webp, jpg, png, bmp, gif. |
compress | Integer | Optional | Lossy compression quality from 0 to 100 (e.g. 80). |
password | String | Optional | Protect access to the uploaded file with a custom password. |
auto-remove | Integer | Optional | Time in minutes after which file is permanently deleted (e.g. 60 for 1 hour). |
watermark | String | Optional | Watermark text overlay on the generated image (up to 20 chars). |
size[width] | Integer | Optional | Max image width in pixels (up to 3840px). |
size[height] | Integer | Optional | Max image height in pixels (up to 2160px). |
Code Examples
curl -X POST "https://imguploadz.com/api/upload" \ -H "token: YOUR_API_TOKEN" \ -F "file=@/path/to/image.jpg" \ -F "compress=80" \ -F "type=webp"
const formData = new FormData();
formData.append('file', fileInputElement.files[0]);
formData.append('compress', 80);
formData.append('type', 'webp');
const response = await fetch('https://imguploadz.com/api/upload', { method: 'POST', headers: { 'token': 'YOUR_API_TOKEN' }, body: formData
});
const data = await response.json();
console.log(data); import requests
url = "https://imguploadz.com/api/upload"
headers = {"token": "YOUR_API_TOKEN"}
files = {"file": open("image.jpg", "rb")}
data = {"compress": 80, "type": "webp"}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json()) <?php
$ch = curl_init('https://imguploadz.com/api/upload');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['token: YOUR_API_TOKEN']);
curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'file' => new CURLFile('/path/to/image.jpg'), 'compress' => 80, 'type' => 'webp',
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$response = json_decode($result, true);
print_r($response); Success Response (200 OK)
{ "result": true, "url": "https://imguploadz.com/file/WbzuUG", "thumb": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
} Error Response (400 Bad Request)
{ "result": false, "data": "The file field is required."
} POST /api/upload-link
multipart/form-dataIngest an image from any publicly accessible HTTP/HTTPS URL. ImgUploadz securely fetches the asset, runs processing, and saves it to cloud storage.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file-link | String (URL) | Required | Public image URL to download and host (e.g. https://example.com/photo.png). |
type | String | Optional | Target format (webp, jpg, png). |
compress | Integer | Optional | Compression level from 0 to 100. |
password | String | Optional | Password protection for the uploaded file. |
auto-remove | Integer | Optional | Auto removal period in minutes. |
cURL Example
curl -X POST "https://imguploadz.com/api/upload-link" \ -H "token: YOUR_API_TOKEN" \ -F "file-link=https://images.unsplash.com/photo-1579783900882-c0d3dad7b119" \ -F "compress=85" \ -F "type=webp"
Status Codes
| Code | Meaning | Details |
|---|---|---|
| 200 OK | Success | The upload completed successfully. Response contains file URL and thumbnail. |
| 400 Bad Request | Invalid Input | Missing required parameters, invalid format, or remote URL could not be fetched. |
| 401 Unauthorized | Invalid Token | Missing or invalid token header, or your account API access is inactive. |
| 429 Rate Limit | Too Many Requests | You have exceeded the API upload rate limits. Slow down requests. |
| 500 Server Error | Internal Error | An unexpected server error occurred during image transformation. |