# Random

## SFW Images

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

#### Headers

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

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

```javascript
{
    "status": 200,
    "content": {
        "id": 34,
        "type": "holo",
        "url": "https://cdn.night-api.com/api/images/sfw/holo/75f9fcb764921bfaedc9e4182db02.jpg"
    }
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

​**Lists of available SFW types:**

* Coffee
* Food
* Holo
* Kanna

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

axios.get('https://api.night-api.com/images/sfw', {
    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.sfw.fetchImage(); // Random images
```
