TypeScript
async function processImages(
imageUrls: string[],
parameters: object,
apiKey: string
): Promise<any> {
const baseUrl = 'https://www.topyappers.com';
const response = await fetch(`${baseUrl}/api/v1/image-rewrite`, {
method: 'POST',
headers: {
'x-ty-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
images: imageUrls.map((imageUrl) => ({ image_url: imageUrl })),
parameters,
}),
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return await response.json();
}
// Usage
const result = await processImages(
['https://example.com/image-1.jpg', 'https://example.com/image-2.jpg'],
{ brightness: 0.02, contrast: 1.05, quality: 94 },
'YOUR_API_KEY'
);import requests
API_KEY = "your-api-key-here"
BASE_URL = "https://www.topyappers.com"
IMAGE_URLS = [
"https://example.com/image-1.jpg",
"https://example.com/image-2.jpg"
]
parameters = {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
response = requests.post(
f"{BASE_URL}/api/v1/image-rewrite",
headers={
"x-ty-api-key": API_KEY,
"Content-Type": "application/json"
},
json={
"images": [{"image_url": url} for url in IMAGE_URLS],
"parameters": parameters
}
)
if response.status_code == 200:
result = response.json()
print(f"Success: {result}")
else:
print(f"Error: {response.text}")curl -X POST https://www.topyappers.com/api/v1/image-rewrite \
-H "x-ty-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"images": [
{ "image_url": "https://example.com/image-1.jpg" },
{ "image_url": "https://example.com/image-2.jpg" }
],
"parameters": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}'const options = {
method: 'POST',
headers: {'x-ty-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
images: [
{image_url: 'https://example.com/image-1.jpg'},
{image_url: 'https://example.com/image-2.jpg'}
],
parameters: {brightness: 0.02, contrast: 1.05, quality: 94}
})
};
fetch('https://www.topyappers.com/api/v1/image-rewrite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.topyappers.com/api/v1/image-rewrite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'images' => [
[
'image_url' => 'https://example.com/image-1.jpg'
],
[
'image_url' => 'https://example.com/image-2.jpg'
]
],
'parameters' => [
'brightness' => 0.02,
'contrast' => 1.05,
'quality' => 94
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ty-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.topyappers.com/api/v1/image-rewrite"
payload := strings.NewReader("{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ty-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.topyappers.com/api/v1/image-rewrite")
.header("x-ty-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.topyappers.com/api/v1/image-rewrite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ty-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Images processed successfully",
"data": {
"imageCount": 2,
"inputImageUrls": [
"https://example.com/image-1.jpg",
"https://example.com/image-2.jpg"
],
"parameters": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
},
"result": {
"metadata": {
"tool_time": 8.42,
"count": 2
},
"data": {
"results": [
{
"url": "https://imgrework.topyappers.com/processed-image-1.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
},
{
"url": "https://imgrework.topyappers.com/processed-image-2.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}
]
}
},
"processedImages": [
{
"url": "https://imgrework.topyappers.com/processed-image-1.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
},
{
"url": "https://imgrework.topyappers.com/processed-image-2.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}
],
"appliedParameters": [
{
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
},
{
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
],
"processingTime": 8.42
}
}
Upload Images for Remix
Process one or more images from provided URLs. The API will download the images, apply transformations, and remove invisible watermarks.
POST
/
api
/
v1
/
image-rewrite
TypeScript
async function processImages(
imageUrls: string[],
parameters: object,
apiKey: string
): Promise<any> {
const baseUrl = 'https://www.topyappers.com';
const response = await fetch(`${baseUrl}/api/v1/image-rewrite`, {
method: 'POST',
headers: {
'x-ty-api-key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({
images: imageUrls.map((imageUrl) => ({ image_url: imageUrl })),
parameters,
}),
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return await response.json();
}
// Usage
const result = await processImages(
['https://example.com/image-1.jpg', 'https://example.com/image-2.jpg'],
{ brightness: 0.02, contrast: 1.05, quality: 94 },
'YOUR_API_KEY'
);import requests
API_KEY = "your-api-key-here"
BASE_URL = "https://www.topyappers.com"
IMAGE_URLS = [
"https://example.com/image-1.jpg",
"https://example.com/image-2.jpg"
]
parameters = {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
response = requests.post(
f"{BASE_URL}/api/v1/image-rewrite",
headers={
"x-ty-api-key": API_KEY,
"Content-Type": "application/json"
},
json={
"images": [{"image_url": url} for url in IMAGE_URLS],
"parameters": parameters
}
)
if response.status_code == 200:
result = response.json()
print(f"Success: {result}")
else:
print(f"Error: {response.text}")curl -X POST https://www.topyappers.com/api/v1/image-rewrite \
-H "x-ty-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"images": [
{ "image_url": "https://example.com/image-1.jpg" },
{ "image_url": "https://example.com/image-2.jpg" }
],
"parameters": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}'const options = {
method: 'POST',
headers: {'x-ty-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
images: [
{image_url: 'https://example.com/image-1.jpg'},
{image_url: 'https://example.com/image-2.jpg'}
],
parameters: {brightness: 0.02, contrast: 1.05, quality: 94}
})
};
fetch('https://www.topyappers.com/api/v1/image-rewrite', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.topyappers.com/api/v1/image-rewrite",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'images' => [
[
'image_url' => 'https://example.com/image-1.jpg'
],
[
'image_url' => 'https://example.com/image-2.jpg'
]
],
'parameters' => [
'brightness' => 0.02,
'contrast' => 1.05,
'quality' => 94
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ty-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.topyappers.com/api/v1/image-rewrite"
payload := strings.NewReader("{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ty-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.topyappers.com/api/v1/image-rewrite")
.header("x-ty-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.topyappers.com/api/v1/image-rewrite")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ty-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"images\": [\n {\n \"image_url\": \"https://example.com/image-1.jpg\"\n },\n {\n \"image_url\": \"https://example.com/image-2.jpg\"\n }\n ],\n \"parameters\": {\n \"brightness\": 0.02,\n \"contrast\": 1.05,\n \"quality\": 94\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Images processed successfully",
"data": {
"imageCount": 2,
"inputImageUrls": [
"https://example.com/image-1.jpg",
"https://example.com/image-2.jpg"
],
"parameters": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
},
"result": {
"metadata": {
"tool_time": 8.42,
"count": 2
},
"data": {
"results": [
{
"url": "https://imgrework.topyappers.com/processed-image-1.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
},
{
"url": "https://imgrework.topyappers.com/processed-image-2.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}
]
}
},
"processedImages": [
{
"url": "https://imgrework.topyappers.com/processed-image-1.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
},
{
"url": "https://imgrework.topyappers.com/processed-image-2.jpg",
"applied_params": {
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
}
],
"appliedParameters": [
{
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
},
{
"brightness": 0.02,
"contrast": 1.05,
"quality": 94
}
],
"processingTime": 8.42
}
}
Authorizations
API key for TopYappers API authentication
Body
application/json
- Option 1
- Option 2
Image processing request. Send either image_url for a single image or images for a batch of up to 20 images.
Publicly accessible URL to a single image file
Example:
"https://example.com/image.jpg"
Batch of image URLs and optional image-specific parameters
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Optional image processing parameters. Global parameters apply to every image unless an image includes its own value.
Show child attributes
Show child attributes
Example:
{ "brightness": 0.02, "contrast": 1.05, "saturation": 1.03, "hue": 2, "quality": 94, "zoomFactor": 1.02, "deviceModel": "iPhone 16 Pro" }
⌘I
