bluedot
Documentation / Convert

Convert image by providing URL

This is a REST API provided by passing the URL of the original image to convert an image in AVIF format.

Request

curl -x POST  
       https://avif-service-api.kokoon.cloud/avif/convert
     -H "Authorization: <api_key>"
     -d '{
                    "file_type": "url",
                    "file" : "https://www.example.com/gallery/example.jpg,
                    "compression_ratios" : ["level0", "level1", "level2", "level3"]
                  }'

List of request parameters

Parameter nameTypeDescription
file_typestringtype of original image (URL)
filestringIf file_type is url, the original image url must be passed to this parameter.
Only jpeg, png, gif, webp format files are accepted.
compression_ratioslevel0, level1, level2, level3This is a list of options when converting to avif. Up to 4, level0/level1/level2/level3 are the possible options, and if the compression_ratios parameter is not included in the request, ["level1"] is applied as default.

Regarding the value of levelN, the smaller the N, the lower the compression rate, but the better the image quality.

Response

{
  "id": "823f2450-2323-ds3f-ff3242ddsv2"
}

List of response parameters

Response fieldTypeDescription
idstringconversion id

Response error

Error nameStatusDescription
Insufficient storage507If the quota assigned to user (api-key) is exceeded.
Too many request429In case the number of concurrent avif-converts in the entire server is exceeded.
Forbidden403
  • 1. When providing images outside the range of 64x64<= size <= 8192x8192
  • 2. When providing image files with extensions other than supported
  • 3. This error occurs when other invalid options are provided.
<< PrevVerify UserNext >>Convert image by uploading