---
title: Compress Video
slug: api-marketplace/compress-video
description: Get ready for the upcoming release of an insightful document that is currently being prepared. Discover valuable information and relevant details to be unveiled shortly. Stay tuned for an engaging and informative resource.
createdAt: 2023-04-20T22:39:22.000Z
---

## Introduction

Th&#x65;**&#x20;Compress Video API&#x20;**&#x69;s designed to reduce the file size of large video files without significantly affecting quality. Handling raw video can be expensive in terms of storage and bandwidth. This API provides an efficient way to optimize videos for faster streaming, reduced costs, and improved delivery — all while hosting compressed outputs securely in the cloud.

### Key Features

- **Efficient Compression:** Reduce video file sizes with minimal quality loss.
- **Multiple Quality Modes:** Choose from compression levels like HIGH, MEDIUM, or LOW.
- **Cloud Hosting:** Compressed videos hosted securely and accessible via a URL.
- **TTL (Time-to-Live):** Define how long the compressed video should be stored.

***

## API details

### Endpoint

:::CodeblockTabs
Production Endpoint

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

:::CodeblockTabs
Test Endpoint

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

***

### 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 video to compress                       |
|  quality    |  Mandatory  |  Compression quality. Accepted values: \`HIGH\`, \`MEDIUM\`, \`LOW\`    |
|  ttl        |  Optional   |  Time-to-live for the compressed video (e.g., \`1 day\`, \`7 days\`)    |



```json
{
  "url": "https://persist.signzy.tech/api/files/597821255/download/9bb830a13f82408d9f100b9f35325460c8caecd345894f48a0e7d015de5af708.mp4",
  "quality": "HIGH",
  "ttl": "1 day"
}
```

***

### Code Samples

:::CodeblockTabs
Curl

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/converters/compress-video' \
--header 'Authorization: <auth-key>' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://persist.signzy.tech/api/files/597821255/download/9bb830a13f82408d9f100b9f35325460c8caecd345894f48a0e7d015de5af708.mp4",
    "quality": "HIGH",
    "ttl": "1 day"
}'
```

Node.js

```nodejs
import requests

url = "https://api.signzy.app/api/v3/converters/compress-video"
headers = {
    "Authorization": "<auth-key>",
    "Content-Type": "application/json"
}
data = {
    "url": "http://example.url.com/BigBuckBunny.mp4",
    "quality": "HIGH",
    "ttl": "1 day"
}

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

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

```

Python

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

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

axios.post(url, {
    url: "http://example.googleapis.com/BigBuckBunny.mp4",
    quality: "HIGH",
    ttl: "1 day"
}, {
    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);
});

```

GO

```go
package main

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

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

	payload := map[string]string{
		"url":     "http://example.googleapis.com/BigBuckBunny.mp4",
		"quality": "HIGH",
		"ttl":     "1 day",
	}
	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. |
| compressedVideo | String        | Public URL of the compressed image     |



:::CodeblockTabs
200

```json
{
    "result": {
        "compressedVideo": "https://example.com/api/files/download/abc.mp4"
    }
}
```

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"
}
```
:::

