Denda Vivas

Convert - Resize Images

Supported formats:

The API allows compressing the original files and converting them to webp or avif format




Method:POST<<Api KEY>>


  • image_urlpdf file source <<>>.
    *only https otherwise the error <<"code": "ERR_INVALID_PROTOCOL">> will appear
  • resize → specific image size. Initial value <<null>>,will take over the original dimensions of the images.
    *only numerical values, only the width of the images is specified, the height will be set according to the width so as not to affect the quality of the images.
  • options → specify the format of the converted images:webp,avif or null
    (conversion is disabled, only image compression will remain active).
  • sufix → adds an identifier to the images resulting from the conversion: false or true.

sufix:true "convert" : "<<API KEY>>/finall_image/<<name>_avi.avif" "convert" : "<<API KEY>>/finall_image<<name>_web.webp"
sufix:false "convert" : "<<API KEY>>/finall_image/<<name>.avif" "convert" : "<<API KEY>>/finall_image<<name>.webp"


'Content-Type': 'application/json' { "image_url" : "", "resize" : dimensions <<numerical values>> or null, "options" : "webp" or "avif" or null , "sufix" : true or false }

Code snippet:

                            let  header = new Headers();
                            header.append("Content-Type", "application/json");
let data = JSON.stringify({ "image_url": "", "resize": 800, "options": "webp", "sufix": true });
let options = { method: 'POST', headers: header, body: data, redirect: 'follow' };
fetch("<<APY KEY>>", options) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.log('error', error));
                            const axios = require('axios');
let data = JSON.stringify({ "image_url": "", "resize": 800, "options": "webp", "sufix": true });
let config = { method: 'post', url:"<<APY KEY>>", headers: { 'Content-Type': 'application/json' }, data : data };
axios(config) .then(function (response) { console.log(JSON.stringify(; })
.catch(function (error) { console.log(error); });
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => '<<APY KEY>>', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "image_url":"", "resize":800, "options": "webp", "sufix": true }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), ));
$response = curl_exec($curl); if (curl_errno($curl)) { print "Error: " . curl_error($curl); } echo '<pre>'; print_r($response); echo '<pre>'; curl_close($curl);
                                let settings = {
                                "url": "<<APY KEY>>",
                                "method": "POST",
                                "timeout": 0,
                                "headers": {
                                "Content-Type": "application/json"
"data": JSON.stringify({ "image_url": "", "resize": 800, "options": "webp", "sufix": true }), }
$.ajax(settings).done(function (response) { console.log(response); });


The final answer that appears when or executed all functions without the problem.

                            "compress":"<<APY KEY>>/compress_image/<<name>>.jpg/png/jpeg....",
                            "convert":"<<APY KEY>>/finall_image/<<name>>.webp"

Occurs when the site's URL is invalid or does not contain that file.

                                "status":"Not Found",
                                "message":"url invalid"

Appears when the specified api key is not identified in the database.

                                "message":"Invalid Api Key"

Allowed values: options:"webp" or options:"avif"

                            "code":'Invalid options value | 'webp' or 'avif' are allowed.'

Allowed values: sufix:true or sufix:false

                            "code":'Invalid sufix value | true or false are allowed.'

It can be caused by incorrect image saving.

                            "status":'failed to extract data from image',