# 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="/files/ooLgEp6l75Go0F67bvpw" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/2zIsmUyjKgcrjF970GFm" 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"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.market/api-product-docs/magicapi/image-restoration-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
