> For the complete documentation index, see [llms.txt](https://docs.night-api.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.night-api.com/images/nsfw/id.md).

# ID

## NSFW Images

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

#### Path Parameters

| Name                                 | Type   | Description                 |
| ------------------------------------ | ------ | --------------------------- |
| id<mark style="color:red;">\*</mark> | Number | The id of NSFW image to get |

#### 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": "Bad type provided"
}
```

{% endtab %}
{% endtabs %}

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

axios.get('https://api.night-api.com/images/nsfw/5', {
    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(5); // Image with the ID 5
```
