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 after signing up for a Pro plan.
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. |