Back to Upload

API Reference

Interactive API documentation and testing

๐Ÿงช Interactive API Tester


                    

Upload Endpoint

POST /api/upload

Upload images via file upload or URL import with optional custom naming.

Parameters

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

Response Format

Success Response (200)

{
  "success": true,
  "url": "https://your-domain.com/i/abc2ef.jpg",
  "filename": "abc2ef.jpg",
  "size": 1024000,
  "format": "JPEG",
  "upload_time": "2025-06-11T22:15:30Z"
}

Error Response (400/500)

{
  "success": false,
  "error": "File too large (max 20MB)"
}

Image Access

GET /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

Code Examples

cURL - File Upload

curl -X POST \
  -F "file=@image.jpg" \
  -F "name=my-custom-name" \
  https://your-domain.com/api/upload

JavaScript - URL Import

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);

Python - File Upload

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'])