# Random

## NSFW Images

<mark style="color:blue;">`GET`</mark> `https://api.night-api.com/images/nsfw`

#### Headers

| Name                                            | Type   | Description  |
| ----------------------------------------------- | ------ | ------------ |
| authorization<mark style="color:red;">\*</mark> | String | Your API key |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "status": 200,
    "content": {
        "id": 23,
        "type": "ass",
        "url": "https://cdn.night-api.com/api/images/nsfw/ass/4208ec0c4590ed4622e451f386e39.jpg"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "status": 400,
    "content": "Invalid key"
}
```

{% endtab %}
{% endtabs %}

**Lists of available NSFW categories:**

* Anal&#x20;
* Ass&#x20;
* Boobs&#x20;
* Gonewild&#x20;
* Hanal&#x20;
* Hass&#x20;
* Hboobs&#x20;
* Hentai&#x20;
* Hkitsune&#x20;
* Hmidriff&#x20;
* Hneko&#x20;
* Hthigh&#x20;
* Neko&#x20;
* Paizuri&#x20;
* Pgif&#x20;
* Pussy&#x20;
* Tentacle&#x20;
* Thigh&#x20;
* Yaoi

```javascript
const axios = require("axios");

axios.get('https://api.night-api.com/images/nsfw', {
    headers: {
        authorization: "Your API token"
    }
})
.then(function (response) {
    console.log(response.data);
})
```

\
Or with the module

```javascript
// Return: Promise

const { NightAPI } = require('night-api');
const api = new NightAPI('YOUR_API_KEY');

const image = await api.nsfw.fetchImage(); // Random images
```
