# Polling mode

It is possible to poll the accumulated data from the Ruuvi Gateway via HTTP.

On the "Access Settings" page, enable bearer authentication and set the bearer token:

<figure><img src="/files/vfj3As21HIcoEgmgd4Ky" alt=""><figcaption></figcaption></figure>

After that it is possible to poll data using the "/history" endpoint:

```shell
curl -v http://<RUUVI_GW_IP>/history 
    -H "Authorization: Bearer Uj+4tj24unVekco/lTLTRyxUfv1J8M6U+sbNsKTWRr0="
```

The accumulated data will be returned in JSON format: [HTTP: Time-stamped data from Bluetooth-sensors](/ruuvi-gateway-firmware/data-formats/http-time-stamped-data-from-bluetooth-sensors.md)or [HTTP: Data from Bluetooth-sensors without timestamps](/ruuvi-gateway-firmware/data-formats/http-data-from-bluetooth-sensors-without-timestamps.md)

Example of time-stamped data:

```json
{
  "data": {
    "coordinates": "",
    "timestamp": 1698727580,
    "gw_mac": "F4:D9:16:FE:4F:AD",
    "tags": {
      "E3:75:CF:37:4E:23": {
        "rssi": -51,
        "timestamp": 1698727579,
        "data": "0201061BFF990405164D77BDC74A03FCFF34FFFC87D6DA63CAE375CF374E23",
        "dataFormat": 5,
        "temperature": 28.545,
        "humidity": 76.6325,
        "pressure": 101018,
        "accelX": 1.020,
        "accelY": -0.204,
        "accelZ": -0.004,
        "movementCounter": 218,
        "voltage": 2.686,
        "txPower": -32,
        "measurementSequenceNumber": 25546,
        "id": "E3:75:CF:37:4E:23"
      },
      "F4:1F:0C:28:CB:D6": {
        "rssi": -66,
        "timestamp": 1698727579,
        "data": "0201061BFF99040514F564D7C7B40008FFF403E8B2767A669BF41F0C28CBD6",
        "dataFormat": 5,
        "temperature": 26.825,
        "humidity": 64.5375,
        "pressure": 101124,
        "accelX": 0.008,
        "accelY": -0.012,
        "accelZ": 1.000,
        "movementCounter": 122,
        "voltage": 3.027,
        "txPower": -32,
        "measurementSequenceNumber": 26267,
        "id": "F4:1F:0C:28:CB:D6"
      },
      "C6:A5:B9:E0:AD:06": {
        "rssi": -60,
        "timestamp": 1698727579,
        "data": "0201061BFF99040517C166ACC78C00540004041C8756086435C6A5B9E0AD06",
        "dataFormat": 5,
        "temperature": 30.405,
        "humidity": 65.7100,
        "pressure": 101084,
        "accelX": 0.084,
        "accelY": 0.004,
        "accelZ": 1.052,
        "movementCounter": 8,
        "voltage": 2.682,
        "txPower": -32,
        "measurementSequenceNumber": 25653,
        "id": "C6:A5:B9:E0:AD:06"
      }
    }
  }
}
```

Also, it is possible to request only raw data without decoding:

```bash
curl -v http://<RUUVI_GW_IP>/history?decode=false 
    -H "Authorization: Bearer Uj+4tj24unVekco/lTLTRyxUfv1J8M6U+sbNsKTWRr0="
```

Example of time-stamped data without decoding:

```json
{
  "data": {
    "coordinates": "",
    "timestamp": 1698727580,
    "gw_mac": "F4:D9:16:FE:4F:AD",
    "tags": {
      "E3:75:CF:37:4E:23": {
        "rssi": -51,
        "timestamp": 1698727579,
        "data": "0201061BFF990405164D77BDC74A03FCFF34FFFC87D6DA63CAE375CF374E23"
      },
      "F4:1F:0C:28:CB:D6": {
        "rssi": -66,
        "timestamp": 1698727579,
        "data": "0201061BFF99040514F564D7C7B40008FFF403E8B2767A669BF41F0C28CBD6"
      },
      "C6:A5:B9:E0:AD:06": {
        "rssi": -60,
        "timestamp": 1698727579,
        "data": "0201061BFF99040517C166ACC78C00540004041C8756086435C6A5B9E0AD06"
      }
    }
  }
}
```


---

# 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.ruuvi.com/ruuvi-gateway-firmware/examples/polling-mode.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.
