Developers
Image upload API
Upload images to your RAGE.WTF image host from any program with an API key, and the full response and error reference.
The upload API is what ShareX uses, and any other tool or script can use it too. Uploads land in your image host, with the same limits as uploading in the browser.
Request#
| Part | Value |
|---|---|
| Method | POST |
| URL | https://rage.wtf/api/image-host/upload |
| Header | x-api-key: rage-your-key (API keys) |
| Body | multipart/form-data with the image in the field image (the name file also works) |
The old address https://rage.wtf/api/imagehost/upload works the same way.
Response#
Status 200:
{
"url": "https://rage.wtf/yourname/AbC1234",
"direct_url": "https://...",
"thumbnail_url": "https://...",
"id": "q2V0...",
"short_id": "AbC1234",
"duplicate": false
} | Field | Meaning |
|---|---|
url | The share link, with your chosen domain and name. |
direct_url | The image file itself. |
thumbnail_url | A small preview (up to 400 pixels, WebP). |
id | The image’s internal ID. |
short_id | The 7 character code at the end of the share link. |
duplicate | true if you already had exactly this image in the same folder, and its existing link was returned instead of a copy. |
What happens to the upload#
- With the Image Host plan, it goes into the folder chosen under ShareX uploads go to in the Folders tab, unless an automation sends it somewhere else. On the free plan there are no folders.
- Your expiring uploads setting and upload rules apply.
Limits#
| Limit | Value |
|---|---|
| File types | PNG, JPG, GIF, WebP |
| File size | 10 MB (requests over 12 MB are refused before upload) |
| Image size | 64 megapixels |
| Storage | 50 MB free, 10 GB on the Image Host plan |
| Uploads | 60 per minute per account |
| Key | 1000 requests per hour |
Errors#
Errors return JSON with an error message, which ShareX shows as the error:
{ "error": "Files can be up to 10 MB." } | Status | error |
|---|---|
| 400 | Send the image as multipart form data (field "image"). |
| 400 | Add the image in the "image" field. |
| 400 | The file is empty. |
| 401 | Send your API key in the x-api-key header. |
| 401 | That API key is invalid, expired or rate limited. |
| 403 | This account is suspended. |
| 413 | Files can be up to 10 MB. (also sent straight away, before reading, when the request is over 12 MB) |
| 413 | That image has too many pixels (64 megapixels at most). |
| 413 | Your free 50 MB are full. Delete images or upgrade to the Image Host plan. |
| 413 | Your storage is full. Delete some images to upload more. |
| 415 | That file isn't a readable image. |
| 415 | Use a PNG, JPG, GIF or WebP image. |
| 415 | That image is damaged and can't be read. |
| 429 | You're doing that too often. Try again in 40 seconds. (the wait varies; the retry-after header gives it in seconds) |
| 500 | The upload failed on our side. Try again. |
Examples#
curl#
curl -X POST https://rage.wtf/api/image-host/upload
-H "x-api-key: rage-your-key"
-F "[email protected]" JavaScript (Node.js 20 or newer)#
import { openAsBlob } from 'node:fs';
const form = new FormData();
form.append('image', await openAsBlob('screenshot.png'), 'screenshot.png');
const response = await fetch('https://rage.wtf/api/image-host/upload', {
method: 'POST',
headers: { 'x-api-key': process.env.RAGE_API_KEY },
body: form
});
const data = await response.json();
if (!response.ok) throw new Error(data.error);
console.log(data.url);