Upload images seamlessly, get instant permanent direct links backed by Google Drive storage, and accelerate delivery through Cloudflare's worldwide CDN edge cache.
Drag & drop single or multiple images to upload directly to Google Drive.
Generate a developer API key instantly to integrate image uploads into your apps.
Zero maintenance, global edge distribution, and robust fail-safes.
Access tokens are securely cached in Cloudflare KV for 3300 seconds, eliminating Google OAuth2 roundtrips and preventing rate limits.
Direct links (/i/:fileId) cache image streams directly at 300+ Cloudflare edge data centers for 7 days with immutable headers.
Raw file buffers are inspected for true JPEG, PNG, GIF, and WEBP signatures before hitting Google Drive, rejecting malicious extensions.
Direct upload from terminal or any programming language.
curl -X POST "https://your-domain.pages.dev/api/upload" \
-H "x-api-key: YOUR_API_KEY" \
-F "[email protected]"
// Response (200 OK)
{
"status": "success",
"code": 200,
"data": {
"id": "1abcXYZ...gdrive_id",
"filename": "photo_1729340000.png",
"direct_url": "https://your-domain.pages.dev/i/1abcXYZ...gdrive_id",
"quota": { "remaining_today": 49 }
}
}
Comprehensive code examples, request schemas, and HTTP response specifications.
/api/register
Create a free API key for your application with default 50 upload daily quota.
/api/upload
Upload image file with x-api-key auth header and multipart form.
/i/:fileId
Direct link proxy with Cloudflare Edge Cache and immutable headers.
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://your-domain.pages.dev/api/upload', {
method: 'POST',
headers: {
'x-api-key': 'img_YOUR_API_KEY_HERE'
},
body: formData
});
const result = await response.json();
console.log('Direct URL:', result.data.direct_url);
| Status Code | Error Business Code | Description & Solution |
|---|---|---|
| 200 OK / 201 | SUCCESS |
Image uploaded successfully or key registered. Returns direct image URL and quota. |
| 400 Bad Request | VALIDATION_ERROR / INVALID_IMAGE_TYPE |
Missing file parameter or image failed magic bytes validation. Supported formats: JPEG, PNG, WEBP, GIF. |
| 401 Unauthorized | UNAUTHORIZED |
Missing or invalid API Key. Provide valid key in header x-api-key. |
| 403 Forbidden | FORBIDDEN |
The specified API key has been suspended or banned by the administrator. |
| 413 Payload Too Large | PAYLOAD_TOO_LARGE |
File size exceeds maximum allowed size of 5 MB. Compress the image before uploading. |
| 429 Too Many Requests | RATE_LIMIT_EXCEEDED |
Daily upload quota reached (default 50/day). Limit resets automatically at 00:00 UTC. |
Scan with your smartphone camera to open or download this image instantly.