MegaOptim Image Compression

FREE
By gdarko
Updated 2 days ago
Video, Images
-/10
Popularity Score
-
Latency
-
Success Rate

MegaOptim Image Compression API Documentation

Clever image compression that reduces the image size up to 80%

View API Details
GETResults endpoint
POSTOptimization Endpoint
GETResults endpoint

This endpoint provides results of the optimization

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
X-API-KEYSTRING
REQUIREDThe api key
Required Parameters
proces_idSTRING
REQUIREDThe process id returned by the /optimize endpoint initially.
Optional Parameters
timeoutSTRING
OPTIONALThe timeout of the result endpoint. It will wait until timeout is reached for result.
Code Snippet
unirest.get("https://megaoptim-image-compression.p.rapidapi.com/optimize/{proces_id}/result?timeout=120")
.header("X-RapidAPI-Host", "megaoptim-image-compression.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://megaoptim-image-compression.p.rapidapi.com/optimize/{proces_id}/result
Request Method: GET
Response Headers
Response Body

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://megaoptim-image-compression.p.rapidapi.com/optimize/{proces_id}/result?timeout=120")
.header("X-RapidAPI-Host", "megaoptim-image-compression.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication