# NSFW API

### About

The NSFW (Not Safe For Work) Detector API serves as a sophisticated tool meticulously crafted to scrutinize and categorize images, videos, or textual content for potentially inappropriate or explicit material. Empowered by cutting-edge machine learning algorithms, this API delivers precise and dependable detection of NSFW content, empowering developers to foster safer online environments and shield users from exposure to unsuitable material.

One of the API's standout features lies in its versatility, accommodating analysis across a wide array of media formats, including images, videos, and text. Through its advanced machine learning models, the API swiftly categorizes content into safe or NSFW classifications, equipping developers with actionable insights to tailor their responses accordingly.

In today's fast-paced digital landscape, real-time processing is paramount. The NSFW Detector API rises to the occasion, boasting efficient processing capabilities that ensure swift and timely identification of NSFW material. Moreover, developers enjoy the flexibility of customizable thresholds, enabling them to fine-tune detection parameters to align with the specific needs of their applications.

Underpinning the API's performance is its scalable infrastructure, adept at accommodating varying workloads and catering to applications with diverse user bases. With robust security measures in place, the API guarantees the confidentiality and integrity of analyzed content, safeguarding user privacy and upholding stringent data protection standards.

Integrating the NSFW Detector API into applications, websites, or content moderation systems presents an opportunity to bolster user safety and fortify the online experience. Whether employed for filtering explicit content, enforcing community guidelines, or ensuring compliance with regulatory frameworks, this API furnishes a comprehensive solution for the detection and management of NSFW material, thereby ushering in a new era of digital content moderation.

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

![image](https://telegra.ph/file/dda34f62b4fff12e9aedc.png)

### Curl Requests and Responses

**Process the API**

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

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/magicapi/nsfw/nsfw' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "image": IMAGE_URL
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

data = '{\n  "image": IMAGE_URL\n}'

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

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/magicapi/nsfw/nsfw');
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/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n  \"image\": IMAGE_URL\n}");

$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/magicapi/nsfw/nsfw',
  '{\n  "image": IMAGE_URL\n}',
  {
    headers: {
      'accept': 'application/json',
      'x-api-market-key': 'API_KEY',
      'Content-Type': 'application/json'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/magicapi/nsfw/nsfw', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
    'Content-Type': 'application/json'
  },
  body: '{\n  "image": IMAGE_URL\n}'
});
```

{% endtab %}
{% endtabs %}

{% code fullWidth="false" %}

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

{% endcode %}

**Get the result**

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

```bash
fetch('https://prod.api.market/api/v1/magicapi/nsfw/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  }
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

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

response = requests.get('https://prod.api.market/api/v1/magicapi/nsfw/predictions/REQUEST_ID', headers=headers)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/magicapi/nsfw/predictions/REQUEST_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-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://prod.api.market/api/v1/magicapi/nsfw/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  }
});
```

{% endtab %}

{% tab title="Javascript" %}

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

{% endtab %}
{% endtabs %}

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


---

# 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/nsfw-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.
