# API Documentation

Anything sent to <https://api.chew.pro/\\>\* will be redirected to <https://chew.pw/api/$1>. This shouldn't matter as most handle redirects automatically, but if it doesn't, replace <https://api.chew.pro> with <https://chew.pw/api>.

You can tell these are in order of how I made them because the responses get better. This is all. Enjoy responsibly or I'll use CloudFlare to erase your homework.

## TRBMB

<mark style="color:blue;">`GET`</mark> `https://api.chew.pro/trbmb`

This endpoint allows you to get a random TRBMB Phrase. From: <https://trbmb.chew.pw\\>
This accepts both a header or a query for the "amount" parameter. The header is deprecated, please use the query.

#### Query Parameters

| Name   | Type   | Description                                 |
| ------ | ------ | ------------------------------------------- |
| amount | string | The amount of phrases to return (1 default) |

#### Headers

| Name   | Type    | Description                                 |
| ------ | ------- | ------------------------------------------- |
| amount | integer | The amount of phrases to return (1 default) |

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

```javascript
["That really CHEWS my API"]
```

{% endtab %}
{% endtabs %}

## Acronym Generator

<mark style="color:blue;">`GET`</mark> `https://api.chew.pro/acronym/:acronym`

From: <https://acronym.chew.pro>

#### Path Parameters

| Name     | Type   | Description                       |
| -------- | ------ | --------------------------------- |
| :acronym | string | the acronym you want to be filled |

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

```javascript
{
    "phrase": "United Wolf Usb"
}
```

{% endtab %}
{% endtabs %}

## ChewSpeak

<mark style="color:blue;">`GET`</mark> `https://api.chew.pro/chewspeak`

my own language. converts text to chewspeak. which is: after every 2 letters, the 1st letter is placed. eg abc = abac. I made this during some exam, I was bored.

#### Query Parameters

| Name  | Type   | Description |
| ----- | ------ | ----------- |
| input | string | Your input  |

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

```javascript
{
    "input": "abc",
    "output": "abac"
}
```

{% endtab %}
{% endtabs %}

## Random String

<mark style="color:blue;">`GET`</mark> `https://api.chew.pro/random`

Generates a random string (of letters) at a specified length. Default 16.\\

#### Query Parameters

| Name   | Type   | Description                                                                                                                                       |
| ------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| kind   | string | The kind of random data to return. Currently: "alphanumeric" (default), "base64" (for a truly random base64 string), or "uuid" for a random UUID. |
| length | string | length of random string (2 <= x <= 1000)                                                                                                          |

{% tabs %}
{% tab title="200 An example of a random response" %}

```javascript
{
    "response": "JvwgnjzWpbBhDvuOmLuoPtklXfxpgWsYCEgRYeJvGoxePbulos"
}
```

{% endtab %}
{% endtabs %}

## SpigotDrama

<mark style="color:blue;">`GET`</mark> `https://api.chew.pro/spigotdrama`

An API Implementation of <https://drama.essentialsx.net> by mdcfe!

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

```javascript
{
    "response": "Proximyst pings @everyone to announce Luck stole a pom.xml from Spottedleaf",
    "permalink": "https://drama.essentialsx.net/eyJzZW50ZW5jZSI6NTIsInBlb3BsZSI6WzIyLDIxLDQyXSwiY29kZSI6WzExXSwic2F5cyI6WzldfQ=="
}
```

{% endtab %}
{% endtabs %}
