# Connecting displays

BierBot Bricks exposes an API to query information about your currently ongoing brews. You will get the brew name, current and target temperatures, and (if the next step is due after a set amount of time and the temperature was reached) the time until the the next action.

## Endpoint for getting statistics about currently running brews.

<mark style="color:blue;">`GET`</mark> `https://brewbricks.com/api/iot/v1`

#### Request Body

| Name                                                        | Type   | Description                                                                                                 |
| ----------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| apikey<mark style="color:red;">\*</mark>                    | String | your API key as for all other Bricks                                                                        |
| type<mark style="color:red;">\*</mark>                      | String | always has to be `display`                                                                                  |
| brand<mark style="color:red;">\*</mark>                     | String | always has to be `oss`                                                                                      |
| version<mark style="color:red;">\*</mark>                   | String | version of the display software running                                                                     |
| chipid<mark style="color:red;">\*</mark>                    | String | A uniquie identifier for this Brick. Can be the chip ID or also any other unique and always permanent value |
| d\_object\_information\_0<mark style="color:red;">\*</mark> | String | Specifies the shape of your display. I.e. `4x20` for a typical 4 by 20 display.                             |

{% tabs %}
{% tab title="200: OK If everything was OK. Sample response body can be found below." %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

A sample response looks like this:

```
{
    "result": "success",
    "error": 0,
    "error_text": "",
    "warning": 0,
    "warning_text": "",
    "settings": {
        "temperatureUnit": "celsius",
        "displayBrewEveryS": 5,
        "showLocalIP": false
    },
    "brews": [
        {
            "currentTemperatureC": {
                "na": -273,
                "primary": 10,
                "secondary": -273,
                "hlt": -273,
                "mlt": -273
            },
            "id": "T1muylAbPsxkZ389ha1z",
            "name": "Pils (TILT)",
            "targetTemperatureC": 10,
            "nextEvents": [
                {
                    "timeRemainingS": 85587.428,
                    "type": "step"
                }
            ]
        },
        {
            "currentTemperatureC": {
                "na": -273,
                "primary": 11.06,
                "secondary": -273,
                "hlt": -273,
                "mlt": -273
            },
            "id": "DcfimLZm4PFMaTErounA",
            "name": "Pils (iSpindel + Steuerung)",
            "targetTemperatureC": 14,
            "nextEvents": []
        }
    ],
    "next_request_ms": 15000
}
```
