# Image Restoration API

### About

Step into the future of image enhancement with our Image Restoration API, marking a paradigm shift in visual refinement. Seamlessly integrating cutting-edge technology, this solution effortlessly elevates your visual content to new heights, ensuring unparalleled clarity and vibrancy.

Integrating our API into your existing workflows is seamless. Whether you're a seasoned professional photographer, a medical practitioner seeking precise imaging solutions, or an e-commerce platform aiming to showcase products in their best light, our intuitive RESTful endpoints ensure effortless integration with minimal hassle.

From photographs to medical imaging and beyond, our API caters to a diverse array of use cases. Whether you're seeking to eliminate noise, restore lost details, or correct colors to perfection, our versatile solution adapts to meet your every need.

Tailor our API to your unique specifications with customizable parameters and flexible integration options, ensuring it aligns perfectly with your vision. Rest assured, your data is safeguarded with utmost care. Our robust encryption and data protection measures guarantee security and reliability at every step.

#### Developer Portal: <https://api.market/store/magicapi/restoration>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FcyZWprRRMbbGXAczlohv%2Fcolor%20enhancement%20(4).jpg?alt=media&#x26;token=6e06ae99-ec22-42bc-be8a-c7f00926c059" alt=""><figcaption></figcaption></figure>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FE7Sp2trqTWveOCzjdoCi%2Fcolor%20enhancement%20(5).jpg?alt=media&#x26;token=931c922c-32b3-441f-a995-86e0dcfd397d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://979396929-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJpzXHBiEL3zWqYljGVxS%2Fuploads%2FzJP1JLjoqSDuEMy44pRk%2Fcolor%20enhancement%20(6).jpg?alt=media&#x26;token=ceb700fc-ddc3-4a81-a377-2bc05412d7a5" alt=""><figcaption></figcaption></figure>

### Curl Requests and Responses

**Process the API**

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

```bash
curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/restoration/restoration' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "img": IMAGE_URL,
  "scale": 0, // default value
  "version": "v1.4" // default value
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json',
}

data = '{\n  "img": IMAGE_URL,\n  "scale": 0, // default value\n  "version": "v1.4" // default value\n}'

response = requests.post('https://api.magicapi.dev/api/v1/magicapi/restoration/restoration', headers=headers, data=data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/restoration/restoration');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-magicapi-key: API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n  \"img\": IMAGE_URL,\n  \"scale\": 0, // default value\n  \"version\": \"v1.4\" // default value\n}");

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://api.magicapi.dev/api/v1/magicapi/restoration/restoration',
  '{\n  "img": IMAGE_URL,\n  "scale": 0, // default value\n  "version": "v1.4" // default value\n}',
  {
    headers: {
      'accept': 'application/json',
      'x-magicapi-key': 'API_KEY',
      'Content-Type': 'application/json'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://api.magicapi.dev/api/v1/magicapi/restoration/restoration', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json'
  },
  body: '{\n  "img": IMAGE_URL,\n  "scale": 0, // default value\n  "version": "v1.4" // default value\n}'
});
```

{% endtab %}
{% endtabs %}

```json
{
  "request_id": REQUEST_ID
}
```

**Get the result**

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

```bash
curl -X 'GET' \
  'https://api.magicapi.dev/api/v1/magicapi/restoration/predictions/REQUEST_ID' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: API_KEY'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
}

response = requests.get('https://api.magicapi.dev/api/v1/magicapi/restoration/predictions/REQUEST_ID', headers=headers)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/restoration/predictions/REQUEST_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-magicapi-key: API_KEY',
]);

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.get('https://api.magicapi.dev/api/v1/magicapi/restoration/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY'
  }
});
```

{% endtab %}

{% tab title="Javascript" %}
{% code fullWidth="false" %}

```javascript
fetch('https://api.magicapi.dev/api/v1/magicapi/restoration/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY'
  }
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

```json
{
  "status": "succeeded",
  "result": "RESULT_URL"
}
```
