llms.txt Content
# Terra API Documentation
<introduction>
Terra offers a suite of APIs and SDKs designed to unify access to health, fitness, and sensor data from a vast array of sources. It acts as a single integration point, abstracting the complexities of individual provider APIs (like Garmin, Fitbit, Apple Health, Strava, etc.).
</introduction>
<problem_solved>
- Eliminates the need for developers to build and maintain separate integrations for each data provider.
- Provides standardized data formats across different sources.
- Offers real-time data streaming capabilities.
- Manages authentication flows with various providers.
</problem_solved>
<main_terra_components>
<component>Health & Fitness API (Web API): Primarily for server-to-server interactions. Used for fetching historical data, receiving data updates via webhooks, and writing data back to certain providers.</component>
<component>Mobile SDKs: Native libraries for iOS (Swift), Android (Kotlin), and wrappers for React Native and Flutter. Required for accessing data sources that *lack* a web API (Apple Health, Samsung Health, Google Fit via Health Connect). Also used as the "Producer" component in the Streaming API.</component>
<component>
Streaming API: Enables real-time data transmission (e.g., heart rate per second) using WebSockets.
- Producer: Usually a mobile app using a Terra Real-Time (RT) SDK, connected to a wearable.
- Broker: Terra's central WebSocket server.
- Consumer: Your backend service listening to the WebSocket stream from the broker.
</component>
</main_terra_components>
<Terra Research>
<The January Activity Spike: A two-day Story -- Terra Research analyzed wearable activity from 3,000+ users (Jan–Mar 2025) and found a real but fleeting New Year “resolution effect”: steps rose 13.3% on Jan 1, most people returned to baseline within 48 hours, only ~1 in 4 stayed elevated past day 4, and the biggest lift came from the least-active quartile (~+25%) rather than already-fit users.>
<Sleep Pa