Image Hosting API: Upload Images with One POST Request

The MyIMGs.org image hosting API uploads an image and returns a direct link in one request. Send a file or a base64 image with your API key and get JSON back, ready for apps, websites and forums. Every image is served from a CDN over HTTPS. API access is included in every Pro plan, from $3.29 a month.

Get your API key See the quick start

How to get an image hosting API key

  1. Create a free MyIMGs.org account and verify your email.
  2. Choose a plan on the Pro plans and prices page. API access is part of every Pro plan.
  3. Open your account page and choose Create API key.
  4. Copy the key. It is shown once. If you lose it, make a new key and the old one stops working.

Upload an image with curl (quick start)

Replace YOUR_API_KEY with your key and run:

curl -X POST https://myimgs.org/api/v1/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@photo.jpg"

The reply is JSON. Use data.url as the direct image link and data.viewer_url for the page that shows the image:

{
  "success": true,
  "data": {
    "id": "AbC12xyz",
    "name": "photo",
    "extension": "jpg",
    "size": 245891,
    "url": "https://myimgs.org/storage/images/61178/photo.jpg",
    "viewer_url": "https://myimgs.org/image/AbC12xyz"
  }
}

Image upload API reference

One endpoint: POST https://myimgs.org/api/v1/upload

Authentication

Send your key in the Authorization: Bearer YOUR_API_KEY header. For scripts written for ImgBB, a key form field works too. Use the header when you can, because form fields can end up in server logs.

Request fields

FieldRequiredDescription
imageYesThe image file (multipart form data), or a base64 string. A data URI such as data:image/png;base64,... is accepted.
nameNoFile name for the stored image. Only letters, numbers, dash and underscore are kept. Defaults to the uploaded file name.
keyNoYour API key, if you do not use the Authorization header.

Response fields

FieldDescription
successtrue when the image was stored.
data.idShort ID of the image.
data.nameStored file name, without extension.
data.extensionjpg, png, gif or webp, taken from the real file content.
data.sizeStored size in bytes.
data.urlDirect image link. Use it in <img> tags, BBCode and apps.
data.viewer_urlLink to the page that displays the image.

Image upload API examples in JavaScript, Python and PHP

JavaScript (Node.js 18 or newer)

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://myimgs.org/api/v1/upload", {
  method: "POST",
  headers: { Authorization: "Bearer YOUR_API_KEY" },
  body: form,
});
const json = await res.json();
console.log(json.data.url);

Python (requests)

import requests

r = requests.post(
    "https://myimgs.org/api/v1/upload",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    files={"image": open("photo.jpg", "rb")},
)
print(r.json()["data"]["url"])

PHP (cURL)

$ch = curl_init("https://myimgs.org/api/v1/upload");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY"],
    CURLOPT_POSTFIELDS => ["image" => new CURLFile("photo.jpg")],
    CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
echo $data["data"]["url"];

Upload a base64 image

Useful when the image only exists in memory, for example a canvas or a screenshot:

curl -X POST https://myimgs.org/api/v1/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=$(base64 -w0 photo.jpg)" \
  -F "name=photo"

Large photos upload faster when they are smaller. You can compress images in your browser with the free image compressor before you send them.

Image hosting API errors and status codes

Errors return JSON like {"success": false, "error": "message"} with one of these status codes:

StatusMeaning
201Image stored. The response holds the links.
401The API key is missing or wrong.
403The account has no active Pro plan, or the account is disabled.
413The image is larger than 64 MB.
422No image was sent, the base64 text is invalid, or the file is not a JPG, PNG, GIF or WebP image.
429More than 60 requests in one minute. Wait and retry.

Image hosting API limits

Image size64 MB per image
FormatsJPG, PNG, GIF (animation kept) and WebP
Rate limit60 requests per minute for each account
StorageUnlimited space on Pro plans
DeliveryCDN over HTTPS, direct links work in forums, websites and apps
InputFile upload or base64

ImgBB API alternative

If you already upload with the ImgBB API, switching takes two changes: point the request at https://myimgs.org/api/v1/upload and use your MyIMGs.org key. The key and image fields work the same way, and the direct link comes back in data.url. Pro plans add 64 MB images, no ads and unlimited space.

Image hosting API pricing

The API is included in every Pro plan. Pick the billing period that suits you:

Monthly Plan

$11.49 a month

Annual Plan

$6.49 a month

billed $77.88

3-Year Plan

$3.29 a month

billed $118.44

See Pro plans and get your API key

Image hosting API FAQ

Is there a free image hosting API?

Uploading with the API needs a Pro plan, which starts at $3.29 a month. A free account hosts up to 50 images from the website and has no API key.

What is the maximum image size for the API?

64 MB per image. Larger files get a 413 error.

Which image formats does the image upload API accept?

JPG, PNG, GIF and WebP. The format is read from the file itself, so a file with the wrong extension is still checked by its real content, and anything that is not a real image is refused. Animated GIFs stay animated.

Can I upload an image from a URL?

No. Send the file as multipart form data, or send the image as a base64 string. Fetching URLs is left out on purpose for security.

Can I delete images with the API?

Not yet. Upload is the only API call for now. Delete images from your dashboard.

How do I change or revoke my API key?

Use Make a new key on your account page. The old key stops working immediately, and the new key is shown once.

What is the API rate limit?

60 requests per minute for each account. Above that the API answers with status 429 until the minute is over.

Do images uploaded with the API expire?

No. There is no expiry setting. Images uploaded with your key stay on your account.

Does the API work with scripts written for ImgBB?

Yes for the upload call. Send the same key and image fields to the MyIMGs.org URL. The direct link comes back in data.url.

MyIMGs.org is a free image hosting service. Upload an image on the home page without an account.