waicore
Back

Quick start

This stores photo.png and answers with a direct link to it. That is the whole API in one line.

curl
curl -F "file=@photo.png" https://imgdb.io/api/v1/upload

Base URL

Every path below is relative to this base, over HTTPS.

https://imgdb.io/api/v1

Upload an image

POSTimgdb.io/api/v1/upload

Stores one image and returns a direct link to it.

Body

Send the image either way:

  • multipart/form-data with a file field, or
  • the raw bytes as the body, with a matching Content-Type.

Parameters

ttlquery or form fieldoptional

Link lifetime in seconds, from the table below. 0 never expires; anything unlisted falls back to 72h.

oncequery or form fieldoptional

Set to 1 for a one-time link - the image is deleted the moment it is viewed.

passwordX-Upload-Password header or form fieldoptional

Puts the image behind a password gate. Prefer the header: query strings end up in server logs.

Link lifetimes

Seconds / Lifetime

3600/1h7200/2h18000/5h43200/12h86400/24h259200/72h604800/7d1209600/14d2592000/30d7776000/90d0/

72h (259200 seconds) is the default when ttl is not sent.

Request

curl
curl -F "file=@photo.png" \
  "https://imgdb.io/api/v1/upload?ttl=86400"

Response

201application/json
{
  "url": "https://imgdb.io/i/Ym5TEo4.png",
  "id": "Ym5TEo4.png",
  "kind": "image",
  "type": "image/png",
  "size": 12345,
  "expires": 1782509812
}

kind is image, protected or once. id is the identifier inside url - only plain image uploads can go into an album. expires is epoch seconds, or null for a link that never expires.

Create an album

POSTimgdb.io/api/v1/album

One link for up to 30 images. Post the files in a single request:

curl / multipart/form-data
curl -F "file=@a.png" -F "file=@b.jpg" -F "file=@c.gif" \
  "https://imgdb.io/api/v1/album?ttl=604800"

Or upload them first and group the ids afterwards. Do it this way for albums over 20 MB - the reverse proxy caps a single request at that, while each image gets its own 16 MB budget.

curl / application/json
curl -X POST https://imgdb.io/api/v1/album \
  -H "Content-Type: application/json" \
  -d '{"items":["Ym5TEo4.png","Rk2p1Za.jpg"],"ttl":604800}'

Response

201application/json
{
  "url": "https://imgdb.io/a/Ym5TEo4",
  "id": "Ym5TEo4",
  "count": 2,
  "expires": 1783114612,
  "protected": false,
  "items": ["Ym5TEo4.png", "Rk2p1Za.jpg"]
}

A password moves the images into a private folder, so they can only be reached through the album gate - the response then omits their ids. Members must be plain image uploads: one-time and password-protected images cannot be grouped. In the two-step flow every image keeps the lifetime it was uploaded with, so give them at least the album's ttl - otherwise the album outlives its own contents.

Look up a link

GETimgdb.io/api/v1/info/<id>

Metadata for an image or an album, without downloading anything. Pass the id you got back from upload or album.

curl
curl https://imgdb.io/api/v1/info/Ym5TEo4.png

Response

200application/json
{
  "kind": "image",
  "id": "Ym5TEo4.png",
  "url": "https://imgdb.io/i/Ym5TEo4.png",
  "type": "image/png",
  "size": 12345,
  "expires": 1782509812
}

One-time and password-protected links are deliberately not exposed here - a one-time link can only be resolved by viewing it, which consumes it.

Limits

  • No key, no token, no signup - the API is open.
  • 20 requests per minute and 100 stored images per day, per IP.
  • 16 MB per image, 30 images per album, 20 MB per request.
  • A 429 response carries a Retry-After header, in seconds.

Accepted formats

PNG, JPG, GIF, WEBP, AVIF and BMP - BMP is converted to PNG. Every image is re-encoded on arrival, which strips EXIF and anything appended after the image data. SVG is not accepted. Links that live longer than 72h are compressed harder to save disk.

Errors

Every failure is JSON: { "error": "…" }, with the status code:

400Bad request - no file, empty body or malformed JSON.
404Not found - no such id.
405Method not allowed - wrong HTTP verb for this path.
410Gone - the link has expired.
413Too large - over the size cap for an image or a request.
415Unsupported type - not one of the accepted formats.
422Could not process - the file is corrupt or not really an image.
429Too many requests - you hit a rate limit; see Retry-After.
500Server error - something broke on our side.

Examples

curl
# a direct link, default 72h lifetime
curl -F "file=@photo.png" https://imgdb.io/api/v1/upload

# 24h link that burns after the first view
curl -F "file=@photo.png" \
  "https://imgdb.io/api/v1/upload?ttl=86400&once=1"

# behind a password
curl -H "X-Upload-Password: hunter2" \
  -F "file=@photo.png" https://imgdb.io/api/v1/upload

# raw bytes instead of multipart, link never expires
curl --data-binary @photo.png -H "Content-Type: image/png" \
  "https://imgdb.io/api/v1/upload?ttl=0"

# one album out of three files
curl -F "file=@a.png" -F "file=@b.jpg" -F "file=@c.gif" \
  "https://imgdb.io/api/v1/album?ttl=604800"

# what is behind a link
curl https://imgdb.io/api/v1/info/Ym5TEo4.png