Introduction
Welcome to the WatermarkRemoverAI API!
Our API allows you to programmatically remove watermarks from images using the same AI technology that powers our web application. Perfect for integrating watermark removal into your own applications, workflows, or batch processing pipelines.
To get your API key, please go to your account page. API credits are available on the API plans page: pay-as-you-go or monthly.
Default Base URL
The default base URL for WatermarkRemoverAI API is: https://api.watermarkremoverai.com/v1/
Note: for security reasons, all APIs are served over HTTPS only.
Authorization
To use the WatermarkRemoverAI API, you'll need the API key from your account.
The authorization value should be sent in the request headers.
Authorization: <api_key>
Remove Watermark
Upload an image with a mask to remove watermarks. The mask should be a black and white image where white areas indicate the watermark to be removed.
import requests
import time
headers = {"Authorization": "your_api_key"}
base_api_url = "https://api.watermarkremoverai.com"
api_url = f"{base_api_url}/v1"
# Upload image with mask
def remove_watermark(image_path, mask_path):
files = {
"file": open(image_path, "rb"),
"mask": open(mask_path, "rb"),
}
response = requests.post(
url=f"{api_url}/watermark/remove-image/",
files=files,
headers=headers
)
return response.json()
# Poll for results
def get_results(uuid):
while True:
response = requests.post(
url=f"{api_url}/watermark/results/",
data={"uuid": uuid},
headers=headers
)
data = response.json()
if data.get("finished"):
return data
elif data.get("error"):
raise Exception(data["error"])
print(f"Queue position: {data.get('queue_count', 0)}")
time.sleep(2)
# Example usage
result = remove_watermark("image.jpg", "mask.png")
print(f"Job submitted: {result['uuid']}")
final = get_results(result["uuid"])
print(f"Result URL: {base_api_url}{final['files'][0]['url']}")
# Remove watermark from image
curl -X POST \
https://api.watermarkremoverai.com/v1/watermark/remove-image/ \
-H 'Authorization: your_api_key' \
-F 'file=@image.jpg' \
-F 'mask=@mask.png'
# Response:
# {"uuid": "abc123-def456-..."}
# Get results
curl -X POST \
https://api.watermarkremoverai.com/v1/watermark/results/ \
-F 'uuid=abc123-def456-...'
# Response when finished:
# {"finished": true, "files": [{"url": "/media/results/...", "filename": "result.jpg"}]}
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const API_URL = 'https://api.watermarkremoverai.com/v1';
const API_KEY = 'your_api_key';
async function removeWatermark(imagePath, maskPath) {
const form = new FormData();
form.append('file', fs.createReadStream(imagePath));
form.append('mask', fs.createReadStream(maskPath));
const response = await axios.post(
`${API_URL}/watermark/remove-image/`,
form,
{
headers: {
...form.getHeaders(),
'Authorization': API_KEY
}
}
);
return response.data;
}
async function getResults(uuid) {
while (true) {
const response = await axios.post(
`${API_URL}/watermark/results/`,
{ uuid },
{ headers: { 'Authorization': API_KEY } }
);
if (response.data.finished) {
return response.data;
}
await new Promise(r => setTimeout(r, 2000));
}
}
// Example usage
(async () => {
const job = await removeWatermark('image.jpg', 'mask.png');
console.log('Job submitted:', job.uuid);
const result = await getResults(job.uuid);
console.log('Result:', result.files[0].url);
})();
Response
{"uuid": "abc123-def456-789..."}
HTTP Request
POST /watermark/remove-image/
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| file | Required | The image file with watermark to be removed. Supports JPG, PNG, WEBP. |
| mask | Required | A black and white mask image where white indicates the watermark area to remove. |
Get Results
Poll this endpoint to check the status of your watermark removal job and retrieve the result when complete.
HTTP Request
POST /watermark/results/
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| uuid | Required | The UUID returned from the remove-image endpoint. |
Response
| Field | Type | Description |
|---|---|---|
| finished | boolean | Whether processing is complete. |
| queue_count | integer | Position in the processing queue (if not finished). |
| files | array | Array of result files with url and filename. |
| error | string | Error message if processing failed. |
Batch removal of a known logo
For many images that carry the same logo (for example a marketplace stamp on every photo). You create a watermark profile once, from your logo file or one logo marked on a sample, plus sample images; we learn where the logo sits and how it is blended. Then you send batches against the profile.
Every image gets a confidence score. Images below the threshold are flagged: returned untouched and not charged. You pay per returned image; re-submit flagged images with force=true to have them processed and charged.
Use the same Authorization header as above. Prices and packs are on the API pricing page. /pricing-developers/#batch
curl -X POST https://api.watermarkremoverai.com/v1/enterprise/profiles/ \
-H "Authorization: YOUR_API_KEY" \
-F name="Catalogue logo" -F terms_accepted=true \
-F logo=@logo.png \
-F samples=@sample1.jpg -F samples=@sample2.jpg -F samples=@sample3.jpg
curl -X POST https://api.watermarkremoverai.com/v1/enterprise/batches/ \
-H "Authorization: YOUR_API_KEY" \
-F profile=PROFILE_ID -F zip=@images.zip \
-F webhook_url=https://example.com/hooks/watermark
curl https://api.watermarkremoverai.com/v1/enterprise/batches/BATCH_ID/ -H "Authorization: YOUR_API_KEY"
curl -o results-1.zip https://api.watermarkremoverai.com/v1/enterprise/batches/BATCH_ID/results/1.zip -H "Authorization: YOUR_API_KEY"
| Endpoint | What it does |
|---|---|
POST /enterprise/profiles/ | Create a profile. Fields: name, terms_accepted=true (you own the images or have the watermark owner's permission), samples (2 to 40 images), and either logo (the logo file) or marks (one logo you marked on a sample).marks=[{"sample": 0, "box": [x, y, width, height]}] |
GET /enterprise/profiles/ID/ | Profile status (learning, ready, failed) and the layouts found. |
POST /enterprise/batches/ | Start a batch. Fields: profile, and one of zip (a ZIP file, up to 2 GB), urls (one image URL per line, or a JSON list) or manifest_url (a signed URL to such a list). Optional: webhook_url, label. |
GET /enterprise/batches/ID/ | Progress, estimated time left, flagged and failed images, report and result links. |
GET /enterprise/batches/ID/report.csv | One row per image: image, layout, confidence, status, method, charged, error. |
GET /enterprise/batches/ID/results/N.zip | Results, in parts of up to 2,000 images or 1 GB each. |
GET /enterprise/batches/ID/images/NAME | One result image, by the name in the report. |
POST /enterprise/batches/ID/resubmit/ | Process flagged images anyway (force=true, optional images list). These are charged. |
POST /enterprise/batches/ID/resume/ | Continue a batch that stopped for lack of balance, after you top up. |
POST /enterprise/batches/ID/cancel/ | Stop a batch. Images already returned stay charged. |
The webhook receives a JSON POST when the batch finishes, signed with the webhook_secret returned at creation: header X-WM-Signature is sha256= followed by the HMAC SHA256 of the body. Webhook and image URLs must be public http or https addresses.
Limits: 3 batches running at a time per account, 100,000 images per batch, results kept for 7 days. An image up to 2 megapixels counts as one; a larger one counts once for each 2 megapixels or part of it.