IXImgyXPastyx
API Reference

ImgyX Documentation

ImgyX is a fast, anonymous file hosting platform with a simple HTTP API. No authentication required. Upload files up to 20MB and get shareable links instantly. All files are stored on encrypted cloud infrastructure.

Base URLhttps://imgyx.pages.dev

Upload a file

POST/api/upload

Accepts multipart/form-data for direct file upload, or application/json with a url field to upload from a remote URL.

cURL — file upload

curl -X POST https://imgyx.pages.dev/api/upload \
  -F "file=@/path/to/image.png"

cURL — URL upload

curl -X POST https://imgyx.pages.dev/api/upload \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/photo.jpg"}'

JavaScript (fetch)

// File upload
const form = new FormData();
form.append('file', fileInput.files[0]);

const res = await fetch('/api/upload', {
  method: 'POST',
  body: form,
});
const data = await res.json();
console.log(data.url); // => "/abc12"

// URL upload
const res = await fetch('/api/upload', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://example.com/file.pdf' }),
});
const data = await res.json();

Python

import requests

# File upload
with open('image.png', 'rb') as f:
    res = requests.post('https://imgyx.pages.dev/api/upload', files={'file': f})
    data = res.json()
    print(data['url'])

# URL upload
res = requests.post(
    'https://imgyx.pages.dev/api/upload',
    json={'url': 'https://example.com/file.pdf'}
)
data = res.json()
print(data['url'])

Response schema

{
  "id":          "abc12",           // Unique file ID
  "url":         "/abc12",          // Raw file URL (relative)
  "preview_url": "/p/abc12",        // Preview page URL (relative)
  "file_name":   "image.png",
  "size":        204800,            // bytes
  "mimetype":    "image/png"
}

Get file info

GET/api/info?id=abc12

cURL

curl https://imgyx.pages.dev/api/info?id=abc12

Response schema

{
  "id":          "abc12",
  "file_name":   "image.png",
  "size":        204800,
  "mimetype":    "image/png",
  "views":       42,
  "created_at":  "2024-01-15T10:30:00Z",
  "url":         "/abc12",
  "preview_url": "/p/abc12"
}

Download / serve file

GET/[id]

Returns the raw file content streamed from encrypted cloud storage. Images and PDFs are served inline; other types as attachments. Append ?inline to force inline delivery.

# Download
curl -O https://imgyx.pages.dev/abc12

# Force inline (for browsers)
curl "https://imgyx.pages.dev/abc12?inline"

Platform stats

GET/api/stats
{
  "total_files":         1234,
  "total_views":         56789,
  "total_storage_bytes": 2147483648
}

Error codes

HTTPCodeMeaning
400NO_FILENo file was provided
400NO_URLURL field is missing
400INVALID_BODYMalformed JSON
404NOT_FOUNDFile not found
413FILE_TOO_LARGEFile exceeds size limit
415UNSUPPORTED_CONTENT_TYPEContent-Type not supported
429RATE_LIMITEDToo many uploads
500UPLOAD_FAILEDInternal upload error
502Cloud storage error

Usage limits

Max file size: 20MB per upload
Rate limit: 1000 uploads/IP/hour
Deduplication: Identical files share the same URL
Retention: Files are stored indefinitely on encrypted cloud storage

FAQ

Is there a size limit?

Yes, 20MB per file by default. This is configurable per deployment.

Do I need an account?

No. ImgyX is fully anonymous. No sign-up, no login.

How long are files stored?

Files are stored indefinitely on encrypted cloud infrastructure.

What happens if I upload the same file twice?

ImgyX deduplicates uploads. You'll receive the same URL as the original upload.

Can I use ImgyX in my app?

Yes. The API is open and CORS-enabled. Just POST to /api/upload.

Where are my files stored?

Files are stored on encrypted cloud infrastructure. No personal data is collected.