> For the complete documentation index, see [llms.txt](https://docs.kawaii.red/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kawaii.red/tutorials/request.md).

# Request

### Python example:

```python
# imports
import aiohttp
import asyncio

# your api token
kawaii_token = "token"

# request
async def kawaii(main, sub, filter):
    async with aiohttp.ClientSession() as session:
        async with session.get(f'https://kawaii.red/api/{main}/{sub}?token={kawaii_token}&filter={filter}') as r:
            js = await r.json()
            return str(js["response"])

# print async environment (normally standard in bot environment)
async def main():
    print(await kawaii("gif", "kiss", []))

# create async environment
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```

### JavaScript example:

```javascript
const { Kawaii } = require("kawaii-api");

const api = new Kawaii("token");

api.get("gif", "kiss").then((result) => {
        console.log(result);
    });

api.endpoints("gif").then((result) => {
        console.log(result);
    });

// or async/await

const get = async() => {
    const result = await api.get("gif", "kiss");
    console.log(result);
}

const endpoints = async() => {
    const result = await api.endpoints("gif");
    console.log(result);
}
```

### C# example:

```csharp
//Our Handle Request gets Created.
using System;
using System.Net.Http;
using System.Net.Http.Json;

//Make the request and make the actually call.
using (var client = new HttpClient())
{
	try
	{
		//Our kawaii API token which we get on https://kawaii.red/dashboard/
		var kawaii_API_token = "";
		
		//Get the Json result from the website
		var response = await client.GetFromJsonAsync<KawaiiRedApi>(
			string.Format("https://kawaii.red/api/gif/{0}?token={1}&filter={2}", "kiss",
				kawaii_API_token, new int[] { })
		);

		//check if the response is not null
		if (response is not null)
		{
			//print our final image into the Console.
			Console.WriteLine($"Image is | {response.Response}");
		}
	}
	catch (Exception e)
	{
		//Catches an Exception and print it into the console.
		Console.WriteLine(e);
		throw;
	}
}
```

#### Output:

```python
"https://api.kawaii.red/gif/kiss/kiss1.gif"
```


---

# 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.kawaii.red/tutorials/request.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.
