Developer API
Base URL: https://api.tempfile.online
REST API untuk upload, download, dan manajemen file sementara. No authentication required.
Limits
| Parameter | Value |
|---|---|
| Max file size | 100MB |
| Rate limit | 200 uploads/hour per IP |
| Retention | 1-24 hours |
| Auth | None required |
Endpoints
POST/api/upload
Upload file (multipart/form-data). Params: file (required), expiry (minutes, default 1440)
curl -X POST https://api.tempfile.online/api/upload?expiry=1440 \
-F "file=@document.pdf"
Response
{
"ok": true,
"file": {
"id": "abc123xyz",
"filename": "document.pdf",
"size": 2048576,
"url": "https://tempfile.online/f/abc123xyz",
"expires_in_seconds": 86400,
"delete_at": "2026-06-10T12:00:00Z"
}
}
POST/api/import
Import from URL (application/json). Body: {"url": "..."}
curl -X POST https://api.tempfile.online/api/import \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/image.jpg"}'
GET/api/files/:id
Get file metadata
curl https://api.tempfile.online/api/files/abc123xyz
GET/api/files/:id/dl
Download file
curl -L https://api.tempfile.online/api/files/abc123xyz/dl -o downloaded.pdf
DELETE/api/files/:id
Delete file early
curl -X DELETE https://api.tempfile.online/api/files/abc123xyz
GET/api/stats
Global stats
curl https://api.tempfile.online/api/stats
Error Codes
| Code | Meaning |
|---|---|
| 400 | Bad request / invalid parameters |
| 404 | File not found |
| 410 | File expired |
| 413 | File too large (>100MB) |
| 415 | Unsupported file type |
| 429 | Rate limit exceeded |