🖼 API Version 1.1
Lensdump API allows users to upload pictures to their account with custom parameters.
Key
Our API works with an user key which is available for each user at https://lensdump.com/settings/api
Request method
API calls can be done using the POST or GET request methods but GET request are limited by the maximum allowed length.
👉 So, POST request method is **recommended**.
Request URL
https://lensdump.com/api/1/upload
Find key in your account settings.
Authorization
Lensdump API supports header authorizaion by passing the X-API-Key header with an API Key.
X-API-Key: your_key
Parameters
Required Parameters
Name | Description |
---|---|
source | A image URL or a base64 encoded image string. Also supports FILES["source"]. |
Optional Parameters
Name | Description |
---|---|
title | Image title |
description | Image description. |
album_id | Image album id, must be owned by the user (encoded string) |
category_id | Category id (integer) |
width | Target resize width (automatic height) |
expiration | Expiration time to auto-delete the image |
nsfw | Not safe for work flag (integer 0,1) |
format | Return format, values json, redirect, txt |
Expiration table
Following values can be used for expiration parameter.
Value | Expires after |
---|---|
PT5M | 5 minutes |
PT15M | 15 minutes |
PT30M | 30 minutes |
PT1H | 1 hour |
PT3H | 3 hours |
PT6H | 6 hours |
PT12H | 12 hours |
PT1D | 1 day |
PT12D | 2 days |
PT3D | 3 days |
PT4D | 4 days |
PT5D | 5 days |
PT6D | 6 days |
PT1W | 1 week |
PT2W | 2 weeks |
PT3W | 3 weeks |
PT1M | 1 month |
PT2M | 2 months |
PT3M | 3 months |
PT4M | 4 months |
PT5M | 5 months |
PT6M | 6 months |
PT1Y | 1 year |
Compatibility with ShareX
Lensdump supports sharex with ❤️. You can find detailed documentation of ShareX configuration here.
Compatibility with imgbb api
Our API is compatible with all existing imgbb API clients. You just need to use lensdump api key instead of imgbb's.
Example call
POST https://lensdump.com/api/1/upload/
curl --location 'https://lensdump.com/api/1/upload' \
--header 'X-API-Key: chv_EfsF_89c2404e38eac3964_long_key' \
--form 'source=@"/path/to/image/image.ext"'
API response
API responses will vary depending on the format parameter:
Format | Output |
---|---|
json | Image upload info in JSON formt (default) |
txt | Image direct URL in text/plain format |
redirect | Redirects to the image viewer URL |
When using JSON the response output will contain the status_txt and status_code properties.
Example Response (JSON)
{ "status_code": 200, "success": { "message": "image uploaded", "code": 200 }, "image": { "name": "image", "extension": "ext", "size": 53237, "width": 1151, "height": 898, "date": "2014-06-04 15:32:33", "date_gmt": "2014-06-04 19:32:33", "storage_id": null, "description": null, "nsfw": "0", "md5": "c684350d722c956c362ab70299735830", "storage": "datefolder", "original_filename": "image.ext", "original_exifdata": null, "views": "0", "id_encoded": "image_id", "filename": "image.ext", "ratio": 1.2817371937639, "size_formatted": "52 KB", "mime": "image/ext", "bits": 8, "channels": null, "url": "https://lensdump.com/i/image.ext", "url_viewer": "https://lensdump.com/i/image_id", "thumb": { "filename": "image.th.png", "name": "image.th", "width": 160, "height": 160, "ratio": 1, "size": 17848, "size_formatted": "17.4 KB", "mime": "image/ext", "extension": "ext", "bits": 8, "channels": null, "url": "https://lensdump.com/i/image.th.ext" }, "medium": { "filename": "image.md.ext", "name": "image.md", "width": 500, "height": 390, "ratio": 1.2820512820513, "size": 104448, "size_formatted": "102 KB", "mime": "image/ext", "extension": "ext", "bits": 8, "channels": null, "url": "https://i.lensdump.com/i/image.md.ext" }, "views_label": "views", "display_url": "https://i.lensdump.com/i/image.md.ext", "how_long_ago": "moments ago" }, "status_txt": "OK" }