Developers · free API
Free image hosting API
Upload images from your apps, bots and scripts. One request returns a direct link, HTML, BBCode and Markdown.
Get an API keyAuthentication
Create a key under Dashboard → Settings → API Keys. Send it with every request:
Authorization: Bearer YOUR_API_KEYKeep keys on your server. Anyone with a key can upload to and delete from your account.
Upload an image
POST /api/v1/upload
| Field | Description |
|---|---|
| image | Image file (multipart), up to 4 MB |
| url | Public image URL to fetch instead, up to 32 MB |
| name | Optional title, used for the image page |
| expiresIn | Optional auto-delete: 1h (1 hour), 1d (1 day), 1w (1 week), 1m (1 month), 6m (6 months) |
curl -X POST https://imgsharehub.com/api/v1/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "name=Login error"curl -X POST https://imgsharehub.com/api/v1/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/photo.jpg", "expiresIn": "1w"}'import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("image", new Blob([await readFile("photo.jpg")]), "photo.jpg");
const res = await fetch("https://imgsharehub.com/api/v1/upload", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.IMGSHAREHUB_KEY}` },
body: form,
});
const { data } = await res.json();
console.log(data.direct_url);import os, requests
res = requests.post(
"https://imgsharehub.com/api/v1/upload",
headers={"Authorization": f"Bearer {os.environ['IMGSHAREHUB_KEY']}"},
files={"image": open("photo.jpg", "rb")},
)
print(res.json()["data"]["direct_url"])Response (201)
{
"success": true,
"data": {
"id": "a1b2c3",
"url": "https://imgsharehub.com/a1b2c3",
"direct_url": "https://imgsharehub.com/i/a1b2c3.webp",
"html": "<a href=\"https://imgsharehub.com/a1b2c3\" target=\"_blank\"><img src=\"https://imgsharehub.com/i/a1b2c3.webp\" alt=\"Image hosted on ImgShareHub\" /></a>",
"bbcode": "[url=https://imgsharehub.com/a1b2c3][img]https://imgsharehub.com/i/a1b2c3.webp[/img][/url]",
"markdown": "[](https://imgsharehub.com/a1b2c3)",
"width": 1920,
"height": 1080,
"size": 284512,
"private": false,
"expires_at": null
}
}Get or delete an image
Works for images owned by the key's account. GET also returns created_at and views.
curl https://imgsharehub.com/api/v1/images/a1b2c3 \
-H "Authorization: Bearer YOUR_API_KEY"curl -X DELETE https://imgsharehub.com/api/v1/images/a1b2c3 \
-H "Authorization: Bearer YOUR_API_KEY"Limits and errors
Each key can upload 100 images per hour and make 1,000 other requests per hour. Every response includes X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers. Errors return {"success": false, "error": "..."}.
| Status | Meaning |
|---|---|
| 400 | Missing image, unsupported file, file too large, or a URL that can't be fetched |
| 401 | Missing, unknown or revoked API key |
| 404 | Image not found, or it doesn't belong to your key's account |
| 429 | Rate limit reached; see the X-RateLimit-Reset header |
| 500 | Something went wrong on our side; retry later |
No code needed
- Forum upload plugin adds an upload button to phpBB, MyBB, SMF and XenForo.
- ShareX config uploads every screenshot automatically on Windows.
API questions
Is the ImgShareHub API free?
Yes. Create up to 5 keys from your account settings. Each key can upload 100 images per hour.
What is the maximum file size?
Files sent directly in the request can be up to 4 MB. For larger images, up to 32 MB, send a public image URL and ImgShareHub downloads it.
Where do images uploaded with the API appear?
In the dashboard of the account that owns the key, alongside images you upload on the website.
Can uploaded images expire automatically?
Yes. Set expiresIn to one of: 1h (1 hour), 1d (1 day), 1w (1 week), 1m (1 month), 6m (6 months). Expired images stop loading immediately.