> For the complete documentation index, see [llms.txt](https://docs.api.market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.market/api-product-docs/capix-ai/ai-picture-upscaler.md).

# AI Picture Upscaler

#### [Try Demo](https://api.market/store/capix/upscaler)

### Details <a href="#details" id="details"></a>

**Endpoints**

**1. Upscaler v1**

This endpoint is used to upscale images using version 1 of the upscaling algorithm.

* **URL:** `https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/`
* **Method:** `POST`
* **Request Body:**

```json
{
  "scale": 2,
  "image_url": "https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg"
}
```

* **Response:** The response will contain the upscaled image data.

Example cURL request:

**2. Upscaler v2**

This endpoint is used to upscale images using version 2 of the upscaling algorithm.

* **URL:** `https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/`
* **Method:** `POST`
* **Request Body:**

```json
{
  "scale": 2,
  "image_url": "https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg"
}
```

* **Response:** The response will contain the upscaled image data.

### Result <a href="#result" id="result"></a>

<figure><img src="/files/O2DXXQjvI3nCVVboml7c" alt=""><figcaption></figcaption></figure>

### Code Examples <a href="#code-examples" id="code-examples"></a>

**Version 1**

{% tabs %}
{% tab title="Curl" %}

```sh
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'scale=2&image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fd0cf3f2b22461f5fcb2a1.png'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png',
}

response = requests.post('https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
    'Content-Type: application/x-www-form-urlencoded',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'scale=2&image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fd0cf3f2b22461f5fcb2a1.png');

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/',
  new URLSearchParams({
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/upscaler/upscaler/v1/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key  },
  body: new URLSearchParams({
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png'
  })
});
```

{% endtab %}
{% endtabs %}

**Version 2**

{% tabs %}
{% tab title="Curl" %}

```sh
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'scale=2&image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fd0cf3f2b22461f5fcb2a1.png'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/x-www-form-urlencoded',
}

data = {
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png',
}

response = requests.post('https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
    'Content-Type: application/x-www-form-urlencoded',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'scale=2&image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2Fd0cf3f2b22461f5fcb2a1.png');

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/',
  new URLSearchParams({
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/upscaler/upscaler/v2/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  },
  body: new URLSearchParams({
    'scale': '2',
    'image_url': 'https://telegra.ph/file/d0cf3f2b22461f5fcb2a1.png'
  })
});
```

{% endtab %}
{% endtabs %}
