API URL:
Method:POST
https://video-gif.denda.ro/api/v1/denda/convert/<<Api KEY>>
Parameters:
When converting YouTube videos, there is a default length limit, videos longer than 5 minutes will not be processed.
When converting videos from other sources there is a preset limit, videos larger than 15 mb will not be processed.
'Content-Type': 'application/json' { "url_video" : "https://domain.ro/video.mp4 or https://www.youtube.com/watch?v=SQQQ9kmbp_w", "type" : "video" or "youtube" "start_time" : "00:00", "set_duration" : 20, "gif_width" : dimensiunea <<valori numerice >> or null, "gif_height" : dimensiunea <<valori numerice >> or null, "frame_number" : 40, "fps" : 5, "webp_status" : true or false }
Code snippet:
let header = new Headers(); header.append("Content-Type", "application/json");
let data = JSON.stringify({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false });
let options = { method: 'POST', headers: header, body: data, redirect: 'follow' };
fetch("https://video-gif.denda.ro/api/v1/denda/convert/<<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({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false });
let config = { method: 'post', url:"https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>", headers: { 'Content-Type': 'application/json' }, data : data };
axios(config) .then(function (response) { console.log(JSON.stringify(response.data)); })
.catch(function (error) { console.log(error); });
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'https://video-gif.denda.ro/api/v1/denda/convert/<<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 =>'{ "url_video":"https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time":"00:00", "set_duration":20, "gif_width":800, "gif_height":800, "frame_number":40, "fps":40, "webp_status":true || false, }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), ));
$response = curl_exec($curl); echo '<pre>'; print_r($response); echo '<pre>'; curl_close($curl);
let settings = { "url": "https://video-gif.denda.ro/api/v1/denda/convert/<<APY KEY>>", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json" },
"data": JSON.stringify({ "url_video": "https://exemple.com/video.mp4 || https://www.youtube.com/watch?v=Pj3q0ZChgFE", "type": "video" || "youtube", "start_time": "00:00", "set_duration": 20, "gif_width": 800, "gif_height": 800, "frame_number": 40, "fps": 5 "webp_status":true || false }), }
$.ajax(settings).done(function (response) { console.log(response); });
Response:
Appears when all functions are executed without problem.
{ "status":"success", "gif":"https://video-gif.denda.ro/file.gif", "webp":"https://video-gif.denda.ro/file.webp" }
Occurs when the site's URL is invalid or does not contain that file.
{ "status":"failed", "message":"url invalid" }
It appears when the time field has an incorrect value.
{ "status":"failed", "message":"invalid conversion type" }
Appears when the YouTube clip exceeds the 5 minute limit.
{ "status":"failed", "message":"YouTube video is too big" }
Appears when the video file exceeds the preset size.
{ "status":"failed", "message":"Video File is too big" }
Occurs when there is an error while extracting the video from YouTube or other sources.
{ "status":"failed", "message":"Error extracting video from (youtube || source)" }
Appears when there is an error when converting the video to gif.
{ "status":"failed", "message":"Error converting to gif: ((error))" }