Interactive API documentation and testing
/api/upload
Upload images via file upload or URL import with optional custom naming.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | Optional* | Image file (multipart/form-data) |
| url | String | Optional* | Public image URL |
| name | String | Optional | Custom filename (max 100 chars) |
* Either file or url is required
{
"success": true,
"url": "https://your-domain.com/i/abc2ef.jpg",
"filename": "abc2ef.jpg",
"size": 1024000,
"format": "JPEG",
"upload_time": "2025-06-11T22:15:30Z"
}
{
"success": false,
"error": "File too large (max 20MB)"
}
/i/<image_path>
Access uploaded images with case-insensitive URLs.
GET /i/abc2ef.jpg GET /i/ABC2EF.JPG (same image) GET /i/my-custom-name.png
curl -X POST \ -F "file=@image.jpg" \ -F "name=my-custom-name" \ https://your-domain.com/api/upload
const formData = new FormData();
formData.append('url', 'https://example.com/image.jpg');
formData.append('name', 'imported-image');
const response = await fetch('/api/upload', {
method: 'POST',
body: formData
});
const result = await response.json();
console.log(result.url);
import requests
files = {'file': open('image.jpg', 'rb')}
data = {'name': 'python-upload'}
response = requests.post(
'https://your-domain.com/api/upload',
files=files,
data=data
)
result = response.json()
print(result['url'])