# 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: 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:

```
GET https://docs.kawaii.red/tutorials/request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
