> For the complete documentation index, see [llms.txt](https://docs.hentaicord.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hentaicord.net/our-features/retrieve-nsfw-media.md).

# Retrieve NSFW media

### Fetch available types and categories

<mark style="color:green;">`GET`</mark>` ``https//api.hentaicord.net/image/types`

Fetch arrays of available types and categories.

#### **Headers**

| Name          | Value            |
| ------------- | ---------------- |
| Authorization | Your token here. |

| Name          | Value            |
| ------------- | ---------------- |
| Authorization | Your token here. |

#### **Response**

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

```json
{
    code: 200,
    message: "Here's an array of our available types and their associated categories.",
    data: [
      { type1: [ "category1", "category2", "category3" ] },
      { type2: [ "category4", "category5", "category6" ] },
      // And so forth...
    ],
    requestsLeft: 499, // Requests you have remaining.
    refreshIn: UnixTimestamp // Time until midnight (UK / London timezone)
}
```

{% endtab %}

{% tab title="500" %}

```json
{
    code: 500,
    message: "Internal Server Error",
    requestsLeft: 499, // Requests you have remaining.
    refreshIn: UnixTimestamp // Time until midnight (UK / London timezone)
}
```

{% endtab %}
{% endtabs %}

***

### Fetch random image from specified type and category

<mark style="color:green;">`GET`</mark>` ``https//api.hentaicord.net/image/fetch/:type/:category`

#### Headers

| Name          | Value            |
| ------------- | ---------------- |
| Authorization | Your token here. |

#### Response

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

```json
{
    code: 200,
    message: "Here's a random image from your specified type and category.",
    data: {
      imageUrl: "https://api.hentaicord.net/assets/:type/:category/image.{ext}",
      chosen: {
        type: "YourSelectedType",
        category: "YourSelectedCategory"
      }
    },
    requestsLeft: 499, // Requests you have remaining.
    refreshIn: UnixTimestamp // Time until midnight (UK / London timezone)
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    code: 400,
    message: "The type or category you supplied is incorrect",
    requestsLeft: 499, // Requests you have remaining.
    refreshIn: UnixTimestamp // Time until midnight (UK / London timezone)
}
```

{% endtab %}

{% tab title="500" %}

```json
{
    code: 500,
    message: "Internal Server Error",
    requestsLeft: 499, // Requests you have remaining.
    refreshIn: UnixTimestamp // Time until midnight (UK / London timezone)
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.hentaicord.net/our-features/retrieve-nsfw-media.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
