Skip to content

Mosaic Removal API

Remove the Mosaic of any image* with 1 API call

$curl -i -k -X POST ‘https://api.mosaicremoval.com/sjccup’ \
-H ‘Authorization:APPCODE YourAppCode’ \
–data ‘{“media_id”:”Base64 encoded value of the image, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64″,”keep_distortion”:boolean type, false – auto-corrects distortion, true – disables correction”,”keep_ori”:boolean type, false – the image will be rotated to the correct orientation, true – retains the orientation when uploaded}’ \
-H ‘Content-Type:application/json; charset=UTF-8’

API Introduction

The Artificial Intelligence technology specialized in Mosaic removal has been made easier than ever before using MosaicRemoval.com API. With just a few lines of code, you can bring this technology into your application.

Getting started

Step 1: Purchase a package dedicated to the API,View Pricing.

Step 2: Email [email protected] to get your dedicated AppCode.

Step 3: Use the following code samples to get started quickly.

Step 4: Getting back to the parameters reference to adjust the request.

Authentication

We authenticate users using special API Key (or App Code). Which can be easily acquired here. The API Key is unique and very different from the others. For security reasons, please do not publish your App Code.

Main.java
public static void main(String[] args) {
    String host = "https://api.mosaicremoval.com";
    String path = "/sjccup";
    String method = "POST";
    String appcode = "YourAppCode";
    Map<String, String> headers = new HashMap<String, String>();
    // The final format in the header (with a space in between) is Authorization:APPCODE 83359fd73fe94948385f570e3c139105
    headers.put("Authorization", "APPCODE " + appcode);
    // Define the corresponding Content-Type according to API requirements
    headers.put("Content-Type", "application/json; charset=UTF-8");
    Map<String, String> querys = new HashMap<String, String>();
    String bodys = "{\"media_id\":\"Base64 encoded image value, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64\",\"keep_distortion\":boolean type, false - auto-corrects distortion, true - disables correction\",\"keep_ori\":boolean type, false - the image will be rotated to the correct orientation, true - retains the orientation when uploaded}";
    try {
        HttpResponse response = HttpUtils.doPost(host, path, method, headers, querys, bodys);
        System.out.println(response.toString());
        // Get the body of the response
        // System.out.println(EntityUtils.toString(response.getEntity()));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
request.php
<?php
    $host = "https://api.mosaicremoval.com";
    $path = "/sjccup";
    $method = "POST";
    $appcode = "YourAppCode";
    $headers = array();
    array_push($headers, "Authorization:APPCODE " . $appcode);
    // Define the corresponding Content-Type according to API requirements
    array_push($headers, "Content-Type" . ":" . "application/json; charset=UTF-8");
    $querys = "";
    $bodys = "{\"media_id\":\"Base64 encoded image value, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64\",\"keep_distortion\":boolean type, false - auto-corrects distortion, true - disables correction\",\"keep_ori\":boolean type, false - the image will be rotated to the correct orientation, true - retains the orientation when uploaded}";
    $url = $host . $path;
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_FAILONERROR, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, true);
    if (1 == strpos("$".$host, "https://")) {
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    }
    curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
    var_dump(curl_exec($curl));
?>
request.py
import urllib, urllib2, sys
import ssl

host = 'https://api.mosaicremoval.com'
path = '/sjccup'
method = 'POST'
appcode = 'YourAppCode'
querys = ''
bodys = {}
url = host + path

bodys[''] = "{\"media_id\":\"Base64 encoded image value, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64\",\"keep_distortion\":boolean type, false - auto-corrects distortion, true - disables correction\",\"keep_ori\":boolean type, false - the image will be rotated to the correct orientation, true - retains the orientation when uploaded}"
post_data = bodys['']

request = urllib2.Request(url, post_data)
request.add_header('Authorization', 'APPCODE ' + appcode)
# Define the corresponding Content-Type according to API requirements
request.add_header('Content-Type', 'application/json; charset=UTF-8')

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

response = urllib2.urlopen(request, context=ctx)
content = response.read()

if (content):
    print(content)
request.m
NSString *appcode = @"YourAppCode";
NSString *host = @"https://api.mosaicremoval.com";
NSString *path = @"/sjccup";
NSString *method = @"POST";
NSString *querys = @"";
NSString *url = [NSString stringWithFormat:@"%@%@%@", host, path, querys];
NSString *bodys = @"{\"media_id\":\"Base64 encoded image value, with the longest side not exceeding 4000px; remove the prefix data:image/png;base64\",\"keep_distortion\":boolean type, false - auto-corrects distortion, true - disables correction\",\"keep_ori\":boolean type, false - the image will be rotated to the correct orientation, true - retains the orientation when uploaded}";

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] 
                                                        cachePolicy:1 
                                                    timeoutInterval:5];
request.HTTPMethod = method;
[request addValue:[NSString stringWithFormat:@"APPCODE %@", appcode] 
    forHTTPHeaderField:@"Authorization"];

// Define the corresponding Content-Type according to API requirements
[request addValue:@"application/json; charset=UTF-8" 
    forHTTPHeaderField:@"Content-Type"];

NSData *data = [bodys dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:data];

NSURLSession *requestSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionDataTask *task = [requestSession dataTaskWithRequest:request
    completionHandler:^(NSData * Nullable body, NSURLResponse *Nullable response, NSError * _Nullable error) {
    NSLog(@"Response object: %@", response);
    NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding];
    // Print the body of the response
    NSLog(@"Response body: %@", bodyString);
}];
[task resume];
Error Code Error Message Description
0 success Success
1000 body error Request body error
1001 param error Request parameter error
1002 content type error Content-Type error
1003 image not exists Image file not found
1004 image size error Image size error
1005 image format error Image format error
1006 invalid signature Invalid signature
1007 body size error Body size error
1008 no authorization Authorization failed
2000 server unknown error Server unknown error
2001 server timeout Server timeout
2003 no content recognition No content recognized
2004 validate data error Validation data error
3000 remote server error Remote server error
4000 base server error Base server error

The following plans are API-exclusive

Lifetime

199 $ 0.199 / Credit
  • 1000 credits
Act Now
Most Popular

Lifetime

599 $ 0.12 / Credit
  • 5000 Credits

Lifetime

999 $ 0.08 / Credit
  • 12000 Credits
Exclusive

100% Money Back Guarantee!

Purchase with peace of mind. If you find out that this tool does not meet your needs, we offer a 7-day no-questions-asked money-back guarantee.You can make the payment with confidence. We have a refund policy to ensure the safety of your payment.