# AI Background Remover

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

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

**Endpoint**

```bash
POST https://prod.api.market/api/v1/capix/rembg/rembg
```

**Request Headers**

* Content-Type: application/json
* x-api-market-key: API\_TOKEN

**Request Body**

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

* image\_url: URL of the image for which the background needs to be removed.

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

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2Fj99MpnfFnFnY6CsQL4eY%2Fimage.png?alt=media&#x26;token=f2109547-4e71-4460-b340-84279d5dd549" alt=""><figcaption></figcaption></figure>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FDOcyAPRiPsWWg1weBeuj%2Fimage.png?alt=media&#x26;token=56320e8a-87f4-481e-8144-be2e456e0437" alt=""><figcaption></figcaption></figure>

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

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

```sh
curl -X 'POST' \
  'https://prod.api.market/api/v1/capix/rembg/rembg' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2F46a973ad6ff03f32b40a0.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 = {
    'image_url': 'https://telegra.ph/file/46a973ad6ff03f32b40a0.png',
}

response = requests.post('https://prod.api.market/api/v1/capix/rembg/rembg', 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/rembg/rembg');
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=https%3A%2F%2Ftelegra.ph%2Ffile%2F46a973ad6ff03f32b40a0.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/rembg/rembg',
  new URLSearchParams({
    'image_url': 'https://telegra.ph/file/46a973ad6ff03f32b40a0.png'
  }),
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

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

{% endtab %}
{% endtabs %}
