imgs.lv
Theme
Mode

API Documentation

Upload to your album from ShareX, scripts, or anything that speaks HTTP. Keys are album-bound and secrets are shown only once.

Authentication

Send the key as a bearer token or header with every request. Replace img_{id}_{secret} with your full secret.

Authorization: Bearer img__••••
X-API-Key: img__••••

Abilities — upload, read, delete — are set per key; missing ability = 403. Each key has a requests-per-minute budget; exceeding it returns 429 with a Retry-After header. Keys authenticate to exactly one album (D12). A banned or revoked key gets 401/403.

Endpoints

POST /api/v1/upload requires upload

Multipart file, JSON base64, or JSON url. Returns ShareX-shaped JSON.

GET /api/v1/images requires read

Paginated listing of the key album. per_page ≤ 100.

GET /api/v1/images/{id} requires read

One image by numeric id (404 outside the key album).

PATCH /api/v1/images/{id} requires read

Move an image INTO the key album: {"album_id": N}.

DELETE /api/v1/images/{id} requires delete

Moves the image to trash for 7 days, then it is purged.

GET /api/v1/albums requires read

The single album this key is bound to.

GET /api/oembed requires —

Public oEmbed JSON for /i/{slug} or direct file URLs. No key needed.

Upload examples

Multipart (curl)

curl -X POST https://imgs.lv/api/v1/upload \
  -H "Authorization: Bearer img__••••" \
  -F "[email protected]"

Base64 (JSON)

curl -X POST https://imgs.lv/api/v1/upload \
  -H "Authorization: Bearer img__••••" \
  -H "Content-Type: application/json" \
  -d '{"base64": "iVBORw0KGgoAAAANSUhEUg...", "name": "cat.png"}'

Remote URL (fetched server-side)

curl -X POST https://imgs.lv/api/v1/upload \
  -H "Authorization: Bearer img__••••" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/photo.jpg"}'

Response (201)

{
  "url": "https://imgs.lv/i/00000000",
  "thumbnail_url": "https://imgs.lv/........-thumb.webp",
  "id": "01J...",
  "md5": "sha256 hex of content",
  "slug": "abcd1234",
  "page_url": "https://imgs.lv/i/abcd1234"
}

Errors

Every error is JSON with a human message; the message is safe to display (ShareX shows it via $json:message$).

401
Missing, unknown, revoked or expired key.
403
Key lacks the ability, or the account is suspended.
404
Unknown id, or an image outside the key album.
413
Over the per-file or storage quota — the message states the actual limit.
415
Kind not enabled (e.g. video uploads, D28).
422
Validation failed (bad source, decoded size, album mismatch). See "errors".
429
Rate limit — back off for Retry-After seconds.

ShareX walkthrough

  1. Open Settings → API Keys and create a key for the album you want ShareX to fill.
  2. While the secret is revealed, click "Download .sharex" — the config embeds the key and points at this endpoint.
  3. In ShareX: File → Import → select the .sharex file (or double-click it).
  4. Drop an image on ShareX — it lands in your album and copies the direct link.

Lost the secret? Rotate the key and download a fresh config — the old secret stops working instantly.

Manage API keys