---
title: Compress Image
slug: api-marketplace/compress-image
description: Sorry, but I can't generate that description for you.
createdAt: 2023-04-20T22:39:25.000Z
---

## Introduction

The **Image Compression API** is a lightweight and efficient tool designed to optimize images for faster loading, reduced storage requirements, and seamless sharing. In today’s web and mobile environments, uncompressed images can significantly slow down performance and consume bandwidth. Our API helps solve this by delivering high-quality compressed images while retaining visual clarity.

### Key Features

- **Optimized Compression:** Reduce image file sizes without compromising visual quality.
- **Seamless Integration:** Simple REST API, easy to plug into any workflow or application.
- **Cloud Hosting:** Compressed images are hosted securely on the cloud, instantly accessible via URL.
- **Multi-Format Support:** Works with JPEG, PNG formats.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

```text
POST https://api.signzy.app/api/v3/converters/compress-Images
```
:::

:::CodeblockTabs
UAT Endpoint

```text
POST https://api-preproduction.signzy.app/api/v3/converters/compress-Images
```
:::

***

### Request Headers

|  Name           |  Required   |  Description                                          |
| --------------- | ----------- | ----------------------------------------------------- |
|  Content-Type   |  Mandatory  |  Type of request body. Must be \`application/json\`.  |
|  Authorization  |  Mandatory  |  Bearer token (API key) for authentication.           |

### Request body parameters

| Parameter | Required  | Description                                       |
| --------- | --------- | ------------------------------------------------- |
| url       | Mandatory | Publicly accessible URL of the image to compress. |

```json
{
  "url": "https://example.com/abc.png"
}
```

***

### Code Samples

:::CodeblockTabs
Curl

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/converters/compress-Images' \
--header 'Authorization: <auth-key>' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/abc.png"
}'
```

Node.js

```nodejs
const axios = require('axios');

const url = "https://api.signzy.app/api/v3/converters/compress-Images";

axios.post(url, {
    url: "https://example.com/abc.png"
}, {
    headers: {
        "Authorization": "<auth-key>",
        "Content-Type": "application/json"
    }
})
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error(error.response ? error.response.data : error.message);
});

```

Python

```python
import requests

url = "https://api.signzy.app/api/v3/converters/compress-Images"
headers = {
    "Authorization": "<auth-key>",
    "Content-Type": "application/json"
}
data = {
    "url": "https://example.com/abc.png"
}

response = requests.post(url, headers=headers, json=data)

print(response.status_code)
print(response.json())

```

GO

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	apiUrl := "https://api.signzy.app/api/v3/converters/compress-Images"

	payload := map[string]string{"url": "https://example.com/abc.png"}
	jsonData, _ := json.Marshal(payload)

	req, _ := http.NewRequest("POST", apiUrl, bytes.NewBuffer(jsonData))
	req.Header.Set("Authorization", "<auth-key>")
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)
	fmt.Println("Status:", resp.Status)
	fmt.Println("Response:", string(body))
}

```
:::

***

### Response body parameters

| **Parameter**   | **Data Type** | **Description**                        |
| --------------- | ------------- | -------------------------------------- |
| result          | Object        | The root object containing the result. |
| compressedImage | String        | Public URL of the compressed image     |



:::CodeblockTabs
200

```json
{
    "result": {
        "compressedImage": "https://example.com/download/abc.png"
    }
}
```

400

```json
{
    "error": {
        "name": "error",
        "message": "URL is required",
        "status": 400,
        "reason": "VALIDATION_ERROR",
        "type": "Bad Request",
        "statusCode": 400
    }
}
```

401

```none
{
    "message": "Invalid authentication credentials"
}
```
:::

