---
title: Image Quality Lite API
slug: api-marketplace/image-quality-lite-api
description: Get ready to access the upcoming document, set to be released soon. Stay tuned for valuable information and insights coming your way.
createdAt: 2023-04-20T21:12:25.000Z
---

## Introduction

The Image Quality Lite API is a streamlined solution for assessing the readability and clarity of document images. This API is tailored to quickly evaluate the overall quality of an image, focusing on its readability and optionally checking for blur when enabled. Users can effortlessly initiate an assessment with a simple request, providing the image URL and setting their desired acceptance threshold. When blur check is activated, the API additionally scrutinizes the image for any signs of blurring, ensuring the image clarity meets specific standards. The response includes a quality rating and a numeric score, offering a concise evaluation of the image's suitability for further processing or analysis. This API is ideal for scenarios where rapid and reliable image quality assessment is essential.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/assess-image-quality/lite
```
:::

:::CodeblockTabs
UAT/Testing Endpoint

```text
POST https://api-preproduction.signzy.app/api/v3/assess-image-quality/lite
```
:::

***

### Request body parameters

| Parameter           | Data Type | Description                                                                                                                                    | Required  |
| ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
| acceptanceThreshold | Float     | The threshold value to be used to compare the image quality scores. The field can take a value between 0.05 and 0.95. The default value is 0.6 | Optional  |
| url                 | String    | Image URL to be tested for image quality.                                                                                                      | Mandatory |
| blurCheck           | Boolean   | To use the blur detection model while evaluating the quality of the image.                                                                     | Optional  |

:::CodeblockTabs
JSON

```json
{
    "acceptanceThreshold": 0.6,
    "url": "https://persist.signzy.xyz/api/files/3938547/download/xxxxx.jpg",
    "blurCheck": true
}
```
:::

***

### Request Headers

| Name          | Value            | Required  | Description                                                                                                |
| ------------- | ---------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api.signzy.app/api/v3/assess-image-quality/lite' \
--header 'Content-Type: application/json' \
--header 'Authorization: <Your access token>' \
--data '{
    "acceptanceThreshold": 0.6,
    "url": "https://persist.signzy.xyz/api/files/3938547/download/5065d677d68c4e249a5da3032c15cdda09a6b77195544db285d7a45c8e75219e.jpg",
    "blurCheck": true
}'
```

```nodejs
const axios = require('axios');
let data = JSON.stringify({
  "acceptanceThreshold": 0.6,
  "url": "https://persist.signzy.xyz/api/files/3938547/download/5065d677d68c4e249a5da3032c15cdda09a6b77195544db285d7a45c8e75219e.jpg",
  "blurCheck": true
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.signzy.app/api/v3/assess-image-quality/lite',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': '<Your access token>'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

```python
import http.client
import json

conn = http.client.HTTPSConnection("api.signzy.app")
payload = json.dumps({
  "acceptanceThreshold": 0.6,
  "url": "https://persist.signzy.xyz/api/files/3938547/download/5065d677d68c4e249a5da3032c15cdda09a6b77195544db285d7a45c8e75219e.jpg",
  "blurCheck": True
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '<Your access token>'
}
conn.request("POST", "/api/v3/assess-image-quality/lite", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.signzy.app/api/v3/assess-image-quality/lite"
  method := "POST"

  payload := strings.NewReader(`{
    "acceptanceThreshold": 0.6,
    "url": "https://persist.signzy.xyz/api/files/3938547/download/5065d677d68c4e249a5da3032c15cdda09a6b77195544db285d7a45c8e75219e.jpg",
    "blurCheck": true
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Authorization", "<Your access token>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| **Parameter**  | **Data Type** | **Description**                                                                                                                                                                      |
| -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| result         | Object        | Contains the Quality check results                                                                                                                                                   |
| result.quality | String        | The output image quality score is compared with the input threshold. If the output quality score is more than the threshold then the value of this field would be "good" else "bad". |
| result.score   | Float         | Image quality score between 0 and 1.                                                                                                                                                 |

:::CodeblockTabs
200

```json
{
    "result": {
        "quality": "good",
        "score": 0.74
    }
}
```

400

```json
// Invalid image URL
{
    "error": {
        "statusCode": 400,
        "name": "Error",
        "message": "Invalid Files"
    }
}

// blurCheck is not boolean
{
    "error": {
        "statusCode": 400,
        "status": "Bad Request",
        "message": "\"requestBody.blurCheck\" must be a boolean",
        "id": "573b7b2a-284c-4b85-83d2-3f9723d455a0"
    }
}

// Incorrect threshold value
{
    "error": {
        "statusCode": 400,
        "name": "Error",
        "message": "threshold should floating point number between 0 and 1"
    }
}
```

409

```json
{
    "error": {
        "reason": "Error From Upstream",
        "status": 409,
        "message": "Upstream Down",
        "type": "Conflict",
        "statusCode": 409,
        "name": "error"
    }
}
```
:::

***

### Document related constraints

:::hint{type="info"}
The size of the document should not exceed **5 MB**.

For best results, ensure the image you use fits tightly in the camera view and horizontally aligned.

Supported document types:

- Image - JPEG, JPG, PNG and TIFF/TIF.
- Single page PDF - In the case of multipage PDF input the API will only consider the first page for image analysis.
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!
