# Request Structure

### Base Url

The base url to retrieve the api is this:

```python
https://kawaii.red/api/
```

{% hint style="info" %}
The output urls are under the domain api.kawaii.red this cannot be used as base url.
{% endhint %}

### Main Endpoint

The main endpoint categorizes the sub endpoints, there are the following main endpoints:

#### Text Endpoint:

```python
https://kawaii.red/api/txt/
```

#### Image Endpoint:

```python
https://kawaii.red/api/png/
```

#### GIF Endpoint:

```python
https://kawaii.red/api/gif/
```

#### Stats Endpoint:

```python
https://kawaii.red/api/stats/
```

### Sub Endpoint

This is the true endpoint here you define exactly what you want from the API.

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

To see a list of all endpoints either add the term "endpoints" as sub endpoint or look at the category list:

{% content-ref url="endpoints/text" %}
[text](https://docs.kawaii.red/endpoints/text)
{% endcontent-ref %}

{% content-ref url="endpoints/image" %}
[image](https://docs.kawaii.red/endpoints/image)
{% endcontent-ref %}

{% content-ref url="endpoints/gif" %}
[gif](https://docs.kawaii.red/endpoints/gif)
{% endcontent-ref %}

{% content-ref url="endpoints/stats" %}
[stats](https://docs.kawaii.red/endpoints/stats)
{% endcontent-ref %}

### Token

The token is essential to associate your api requests to you and to display the stats correctly.

```python
https://kawaii.red/api/gif/kiss?token=token
```

#### If you want to know more check here:

{% content-ref url="tutorials/token" %}
[token](https://docs.kawaii.red/tutorials/token)
{% endcontent-ref %}

### Type

Type is an optional argument that affects the output of the api, you can choose between json and text.

```python
https://kawaii.red/api/gif/kiss?token=token&type=type
```

#### If you want to know more check here:

{% content-ref url="request-structure" %}
[request-structure](https://docs.kawaii.red/request-structure)
{% endcontent-ref %}

{% hint style="info" %}
The default type is json.
{% endhint %}

### Filter

Filter is an optional argument that affects the output of the api, you can basically filter out every response.

```python
https://kawaii.red/api/gif/kiss?token=token&filter=filter
```

#### If you want to know more check here:

{% content-ref url="tutorials/filter" %}
[filter](https://docs.kawaii.red/tutorials/filter)
{% endcontent-ref %}

{% hint style="warning" %}
The filter must be a array of integers.
{% endhint %}

### Using multiple arguments

If you want to use more than one argument, which occurs as soon as you use the type or the filter, you have to separate them with a &.

```python
https://kawaii.red/api/gif/kiss?token=token&type=type&filter=filter
```

{% hint style="danger" %}
The omission of the & can lead to the fact that only one argument is recognized.
{% endhint %}
