# Overview

{% hint style="info" %}
The Terra Streaming API enables real-time data streaming to metrics such as

* Steps
* Heart Rate
* Distance covered
* etc...

on a \~per second basis.

For longer span data, such as **workouts, sleep, daily totals & more**, please refer to the [Wearable API](/health-and-fitness-api/getting-started.md)
{% endhint %}

The **Streaming API** gives access to all wearables that broadcast data through BLE, ANT+, or certain custom bluetooth protocols as well as phone sensors

* Heart rate straps (Polar H10, Garmin HRM Pro, Wahoo TICKR FIT...)
* Certain smartwatches (Apple Watch, [Garmin Fenix 6 & up](https://support.garmin.com/en-US/?faq=Zj1947s6pqAHzBCAhLhrC9), Xiaomi Mi Band 5 & 6...)
* etc..

<div data-full-width="true"><figure><img src="https://files.readme.io/51e8eaf-image.png" alt="" width="563"><figcaption><p>Data flow diagram for data streaming</p></figcaption></figure></div>

***

## How It Works

4 components need to all be working together for the streaming API to deliver data to you

1. **Wearable Device**
2. **Producer (your mobile app, running the Terra RT SDK)**
3. **Terra WebSocket Broker (Terra's server)**
4. **Consumer (your server backend)**

Here's a simplified overview of the process:

1. **Device Connection**: The user connects their wearable device to your mobile app via Bluetooth Low Energy or ANT+, using one of Terra's real-time streaming SDKs.
2. **Producer Setup**: Your mobile app establishes a Terra Streaming Producer connection with the Terra WebSocket Service, utilizing the real-time streaming SDK.
3. **Consumer Setup**: To access the data stream on your server backend, you create a Terra Streaming Consumer connection with the Terra WebSocket Service. Once connected, the wearable data will begin streaming to your server in real time.

***

## Next steps


---

# 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.tryterra.co/streaming-api/getting-started.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.
