API Directory › 🔧 Utilities & Media › ImgBB
API KeyHTTPSCORS

ImgBB API

Simple free image hosting API — upload an image and get a URL.

Auth
API Key
HTTPS
Yes
CORS
Yes
Open ImgBB docs ↗

What it does

ImgBB is a simple image-hosting API. POST an image (as a file, a base64 string or a URL) and get back permanent hosted URLs — full size, display size and thumbnail — plus a delete URL. Handy for user avatars, screenshot uploads and quick image CDNs.

Base URL

https://api.imgbb.com/1

Authentication

Free API key from api.imgbb.com after creating an account. Pass it as the key query parameter. Everything else goes in the multipart/form-data or urlencoded body.

Code examples

curl
curl -s "https://api.imgbb.com/1/upload?key=YOUR_KEY" \
  --data-urlencode "image=https://example.com/photo.jpg" \
  -F "expiration=600"
Python
import base64, requests

with open("photo.jpg", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

r = requests.post(
    "https://api.imgbb.com/1/upload",
    params={"key": "YOUR_KEY"},
    data={"image": b64, "name": "photo"},
    timeout=30,
)
r.raise_for_status()
out = r.json()["data"]
print(out["url"], out["thumb"]["url"], out["delete_url"])
JavaScript
const form = new FormData();
form.append("image", fileInput.files[0]);   // or a base64 string

const res = await fetch(
  "https://api.imgbb.com/1/upload?key=YOUR_KEY",
  { method: "POST", body: form }
);
const { data } = await res.json();
console.log(data.url, data.delete_url);

Rate limits & quotas

No officially published request-rate limit on the free key, but uploads are capped at 32 MB per image and the service is meant for modest volumes. Use expiration (60–15552000 seconds) for auto-deleting temporary uploads. Abuse gets keys revoked.

Key response fields

data.urlDirect link to the full-size image
data.display_urlResized version suitable for embedding
data.thumb.url / data.medium.urlGenerated thumbnail / medium size
data.delete_urlOne-time URL that removes the image
data.size / width / height / mimeImage metadata
success / statustrue / 200 on success

Common errors

400No image field, unsupported format, or file over 32 MB.
403Invalid or revoked key.
Rate messagesToo many uploads in a short window — slow down.

When to use it (and alternatives)

ImgBB is fine for hobby projects, bots and quick prototypes. For production user uploads you want a real object store with signed uploads and transformations — Cloudinary (generous free tier, on-the-fly resizing), imgix, or S3 + CloudFront. Never expose your ImgBB key in client-side code without a proxy.

FAQ

Are ImgBB uploads permanent?

Yes by default. Set the expiration parameter (in seconds) if you want the image auto-deleted after a while.

Can I upload from the browser directly?

Technically yes with FormData, but that exposes your API key. Route uploads through a small backend endpoint that adds the key server-side.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

QR GeneratorImage Compressor

Related Utilities & Media APIs

← Back

More Utilities & Media APIs · All 196 APIs