# AI Picture Colorizer

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

### About API <a href="#about-api" id="about-api"></a>

This endpoint colorizes a grayscale image provided by its URL.

**Endpoint**

```sh
POST /capix/colorizer/colorize/v1/
```

**Request Headers**

* Content-Type: application/json
* token: API\_TOKEN (Replace API\_TOKEN with your actual API token)

**Request Body**

```json
{
  "image_url": "https://w0.peakpx.com/wallpaper/300/84/HD-wallpaper-vintage-view-of-old-main-street-trolleys-grayscale-town-tracks-street-vintage.jpg"
}
```

* **image\_url** (string, required): The URL of the grayscale image to be colorized.

**Response**

The response will contain the colorized version of the input image.

***

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

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

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/colorizer/colorize/v1/' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'image_url=IMAGE_URL'
```

{% 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 = {
    'image_url': 'IMAGE_URL',
}

response = requests.post('https://prod.api.market/api/v1/capix/colorizer/colorize/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/colorizer/colorize/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, 'image_url=IMAGE_URL');

$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/colorizer/colorize/v1/',
  new URLSearchParams({
    'image_url': 'IMAGE_URL'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/capix/colorizer/colorize/v1/', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  },
  body: new URLSearchParams({
    'image_url': 'IMAGE_URL'
  })
});
```

{% endtab %}
{% endtabs %}

### Results

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FvAFsro5lNfdEF9UFdPRi%2Fimage.png?alt=media&#x26;token=f3465006-b03d-4b29-82a7-f986c1d22515" alt=""><figcaption></figcaption></figure>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FKTgbhKkrtFKIkHvB4c0k%2Fimage.png?alt=media&#x26;token=dea45461-98bc-4506-aa5b-4b7025f65f7a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FaLnROzH7BXqoYcC78hld%2Fimage.png?alt=media&#x26;token=ee73e9a7-bf31-4224-ae4f-4b6d30c0c8c3" alt=""><figcaption></figcaption></figure>
