BACK

API Reference

BASE:

RATE LIMITS — 60 UPLOADS/MIN · 30 SHORTENS/MIN per IP

POST /api/upload

Upload File

Upload any file (max 30MB) permanently. Returns a short URL.

Request

curl -X POST \
  -F "file=@photo.jpg" \
  /api/upload

Response

{
  "success": true,
  "url": "/images/ab12",
  "filename": "photo.jpg",
  "fileType": "images"
}
POST /api/upload

Temporary Upload

Upload a file temporarily (max 5MB). Expires in 5 minutes.

Request

curl -X POST \
  -F "file=@photo.jpg" \
  -F "tmp=true" \
  /api/upload

Response

{
  "success": true,
  "url": "/tmp/xy99",
  "filename": "photo.jpg",
  "fileType": "temporary"
}
POST /api/shorten

Shorten URL

Create a short URL. Returns a 4-character code.

Request

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/long/path/here"}' \
  /api/shorten

Response

{
  "success": true,
  "url": "/s/ab12",
  "shortCode": "ab12",
  "originalUrl": "https://example.com/long/path/here"
}
POST /api/shorten

Custom Code

Create a short URL with a custom 4-char alphanumeric code.

Request

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","customCode":"cool"}' \
  /api/shorten

Response

{
  "success": true,
  "url": "/s/cool",
  "shortCode": "cool",
  "originalUrl": "https://example.com"
}

STORED ON GITHUB · SERVED VIA CLOUDFLARE