Terra

Integration

API
Unified API
SDK
SDK
Authentication
Authentication
Streaming
Streaming
Blood
Blood Report API
Planned Workout
Planned Workout
AI Interface
AI Interface

User engagement

Graph API
Graph API
Scores
Health Scores
Rewards
Health Rewards

Use cases

Enterprise
Enterprise
Insurance
Insurance

Developers

Wearable Data
Wearable Data
Community
Community
Documentation
Documentation

Learn

Blog
Blog
Podcast
Podcast
Events
Events
Reports
Reports

Company

Customers
Customers
Careers
Careers
Partners
Partners
Support
Support
Become an integration
Become an integration
next ventures
pioneer fund
samsung next
y combinator
general catalyst

The world's best health apps run on Terra data

ProductsIntegrations Authentication Mobile Development Documentation GraphAPI
DocumentationAPI SDK Quickstart
CommunityBlog Research Community Podcast Github
CompanyAboutCareersCustomersBecome an IntegrationCookies PolicyGDPRPrivacy PolicyTerms of Purchase
© Terra API. 2025 — All rights reserved.

Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

< Blogs
Elliott Yu
Elliott Yu

June 23, 2022

Realtime Data Streaming - Terra API

Terra has been near-real-time since the start. We send a complete payload about an activity or sleep session of a user in one Webhook URL. However, Terra's vision goes beyond this simplistic model. We want to provide real-time data and stream it to our developers as the user does their workout. Today, we make a huge step towards this goal with our new products: Websocket API along with Bluetooth Low Energy (BLE) connections to stream real-time data from wearables to you!

The BLE Connection

BLE connections are done through our Software Development Kits (SDKs). You can seamlessly integrate our SDKs into your app and allow your users to connect to any BLE devices they wish (we support both iOS and Android devices with our SDKs).

We even provide the widget for you and automatic connection of the user to our Websocket API so the only thing you need to do is control when to start or stop streaming.

Bluetooth Low Energy Widget

Streaming Heart Rate Data

After you have established a connection to a BLE device using our Widget above, you can immediately start streaming their data to our Websocket API! As an example, we will try streaming Heart Rate data.

In the widget screen above, TICKR FIT 75B1 is a Heart Rate monitor strap from Wahoo. We will stream the heart rate values from this strap to you through our Websocket API.

Let's say you have pressed "Connect" and it was successful. You can then simply run a function to start streaming (more info on the code in our repository (Android's SDK is used here as an example))

terraRT.startRealtime(type: Connections.BLE, dataTypes: setOf(DataTypes.HEART_RATE))

This function does:

  1. Establish that the device allows for "HEART_RATE" data streaming
  2. Enables the "HEART_RATE" streaming service from the device
  3. Opens and starts streaming the heart rate values to our Websocket API.

That's it on the user's end.

As a developer, you can then connect to our Websocket API to receive this user's data. Let's connect and see what we get:

22704: ↓ {"op":5,"d":{"ts":"2022-06-14T13:24:21.660Z","val":77.0},"uid":"7af41b43-ee18-4222-b4cf-8ab218cf7b6d","seq":14115,"t":"HEART_RATE"}
22704: ↓ {"op":5,"d":{"ts":"2022-06-14T13:24:22.694Z","val":76.0},"uid":"7af41b43-ee18-4222-b4cf-8ab218cf7b6d","seq":14116,"t":"HEART_RATE"}
22704: ↓ {"op":5,"d":{"ts":"2022-06-14T13:24:23.692Z","val":76.0},"uid":"7af41b43-ee18-4222-b4cf-8ab218cf7b6d","seq":14116,"t":"HEART_RATE"}
23510: ↓ {"op":5,"d":{"ts":"2022-06-14T13:24:24.674Z","val":77.0},"uid":"7af41b43-ee18-4222-b4cf-8ab218cf7b6d","seq":14117,"t":"HEART_RATE"}
26685: ↓ {"op":5,"d":{"ts":"2022-06-14T13:24:25.670Z","val":77.0},"uid":"7af41b43-ee18-4222-b4cf-8ab218cf7b6d","seq":14118,"t":"HEART_RATE"}

Incredible! Data from a user connecting their BLE device to your app straight to your backend.

Seems too easy? It's because we made it that way!

Time to stream

The example above shows a simple yet powerful tool that many developers can benefit from.

For example, you can:

  • Build a treadmill that can stream a user's heart rate from their chest strap and display it on the screen
  • Create a virtual reality fitness game where you can stream the player's heart rate, steps, calories burnt, or distance traveled from outside sources
  • Dynamically adapt your workout in an app depending on the user's live heart rate data
  • Recommend music based on the user's current heart rate

If you have any other ideas in mind, go and build it! We did all the heavy lifting in getting the data to you. Now it's time for you to show us what your vision is.

Related Articles

September 2025 updates

October 1, 2025

September 2025 updates

July: Terra Research launches, Lab Reports land in the dashboard with PDF/Image → JSON, and Samsung Health moves to the new Data SDK for a tighter Android integration. 🚀

Alex VenetidisAlex Venetidis
August 2025 updates

September 1, 2025

August 2025 updates

🎉 July Highlights: InBody Goes Global, Faster APIs, and Rock-Solid Data 💪📊

Alex VenetidisAlex Venetidis
July 2025 updates

August 2, 2025

July 2025 updates

July = rock-solid Terra: WHOOP V2, Garmin & Fitbit bug fixes, faster SDKs, plus bulk blood-report uploads with smarter reference ranges. Reliability + data power-ups! 💪🩸

Alex VenetidisAlex Venetidis

More Topics

All Blogs
Team Spotlight
Startup Spotlight
How To
Blog
Podcast
Product Updates
Wearables
See All >
Head of Samsung Next: David Lee

Head of Samsung Next: David Lee

David Lee shares insights from his 30-year journey in healthcare and tech, revealing how his battle with stage four lymphoma shaped his career.

Kyriakos EleftheriouKyriakos Eleftheriou
May 1, 2026
HYROX CGO: Douglas Gremmen

HYROX CGO: Douglas Gremmen

Douglas Gremmen shares how HYROX sold 42,000 tickets in a day and expanded to 15,000 gyms worldwide.

Kyriakos EleftheriouKyriakos Eleftheriou
April 8, 2026
CTO + Director of AI at Flo Health: Roman Bugaev + Vladislav Nedosekin

CTO + Director of AI at Flo Health: Roman Bugaev + Vladislav Nedosekin

Roman Bugaev and Vladislav Nedosekin discuss scaling Flo Health to 80 million users and the AI innovations driving their growth.

Kyriakos EleftheriouKyriakos Eleftheriou
March 2, 2026
Glovo and Yellow.vc Co-Founder: Sacha Michaud

Glovo and Yellow.vc Co-Founder: Sacha Michaud

Sacha Michaud shares how Glovo scaled to 25+ countries and a $2.3 billion acquisition, starting with a simple text button app.

Kyriakos EleftheriouKyriakos Eleftheriou
January 18, 2026
Thriva CTO: Tom Livesey

Thriva CTO: Tom Livesey

Tom Livesey, CTO of Thriva, discusses how the company scaled to deliver over 4 million tests and raised $11 million.

Kyriakos EleftheriouKyriakos Eleftheriou
October 21, 2025