Приложение Squeezeimg
Бесплатно в
Перейти

API Squeezeimg

API документация squeezeimg.com

GetToken

Api method get Token

POST
https://squeezeimg.com/api/getToken

Параметры

Название Тип Описание
login String email for account squeezeimg.com
password String password for account squeezeimg.com

Success 200

Название Тип Описание
status Bollean Status response
token String Api token
HTTP/1.1 200 OK { "status":true, "token":"jhgfdtfyguhijkohg", }

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }

PageCompress

PageCompress

GET
https://api.squeezeimg.com/pageCompress

Параметры

Название Тип Описание
url String The target page url
qlt Number The quality precentage (max 80)
token String Your Api token
method String Method processing image (convert or compress)
to String Target format for method convert (jp2 or webp)

Success 200

Название Тип Описание
path String Url get result processing pageCompress
HTTP/1.1 200 OK { "path":'some_path', }

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }

PageResult

Api method return result processing pageCompress

GET
https://api.squeezeimg.com/pageResult

Параметры

Название Тип Описание
url String The target page url
token String Your Api token.

Success 200

Название Тип Описание
count_image Numder Count find and processed images in page.
old_weight_image Numder Old size all images in page.
new_weight_image Numder Size all processed images in page.
percent_change_page Numder The percentage of the processed images in page.
path_archive String The percentage of the processed images in page.
images Array[] The Array all processed images.
src String The src image url.
format String Method processing image.
src_size Number Size src image.
dest String The processed image url.
dest_size Number Size rocessed image.
percent Number The percentage of the processed image.
expires Date Date expires processed image.
generator String Name and version generator.
HTTP/1.1 200 OK { "count_image":17, "old_weight_image":64268, "new_weight_image":72913, "percent_change_page":-13, "path_archive":'some_path', "images":[], }

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }

Plugin

Api method processing binary file image.

POST
https://api.squeezeimg.com/plugin

Параметры

Название Тип Описание
file_name String The name target processing file.
qlt Number The quality precentage (max 80)
token String Your Api token
method String Method processing image (convert or compress)
to String Target format for method convert (jp2 or webp)
file Binary The form-data object including image file " binary " and file name.
Request example
let req = request.post({ url:URL,encoding:'binary'}, (err, resp, body) => { }); let formData = req.form(); formData.append('file_name',file.relative); formData.append('qlt',options.qlt|| 60); formData.append('token',options.token); formData.append('method',options.method || 'compress'); formData.append('to', options.to || 'webp'); formData.append('file',file.contents,{ filename:file.relative});

Success 200

Название Тип Описание
file Binary Binary buffer compressed image file.

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }

Process

Api method processing by url image

GET
https://api.squeezeimg.com/

Параметры

Название Тип Описание
img String The url target image.
qlt Number The quality precentage (max 80)
token String Your Api token
method String Method processing image (convert or compress)
to String Target format for method convert (jp2 or webp)

Success 200

Название Тип Описание
src String The src image url.
format String Method processing image.
src_size Numder Size src image.
dest String The processed image url.
dest_size Numder Size rocessed image.
percent Numder The percentage of the processed image.
expires Date Date expires processed image.
generator String Name and version generator.
HTTP/1.1 200 OK { "src":"https://upload.wikimedia.org/wikipedia/commons/b/b6/Image_created_with_a_mobile_phone.png", "format":"compress", "src_size":20576088, "dest":"https://s1.squeezeimg.com/compressed-images/4754f71fb867ce2ce1ab41983b1857a1/Image_created_with_a_mobile_phone.png", "dest_size":5398881, "percent":74, "expires":Tuesday, December 22nd, 2020, 4:15:37 PM, "generator":squeezeImg.com version: 1.0.0, }

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }

GetInfo

Getting information about the tariff plan of the account

POST
https://squeezeimg.com/api/getinfo

Параметры

Название Тип Описание
token String Api token

Success 200

Название Тип Описание
status String Status response
email String email account
token String Api token
plan String Tariff plan name
limit Numder Limit of images in the tariff plan
used Numder Number of images used
reset_day Date Date of renewal of the tariff plan
HTTP/1.1 200 OK { "status":true, "email":"test@test.com", "token":"sdfghjklsdfghjkljhgfds", "plan":"MEGA PLUS", "limit":600000, "used":555432, "reset_day":"date", }

Error 4xx

Название Тип Описание
status Bollean Status response
error String Error message
HTTP/1.1 422 { "status":false, "error":"message error", }
We use cookies to make sure you can have the best experience on our website. If you continue to use this site we assume that you will be happy with it. Ok