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

November 21, 2022

WHOOP Integration series Part 1: Getting started with Rest APIs

For years, Garmin, Fitbit, Polar, and other fitness tracking companies have allowed their developer enthusiasts to access their data through (mainly) REST APIs. This has allowed these companies' user base to grow as more and more apps and tools are developed around their data.

After about six months since WHOOP started syncing its data outside of its ecosystem (exclusively to Apple Health), WHOOP has followed suit and started exposing its API endpoints to allow other developers to access and play with their data.

Getting Started

Like Terra's API, WHOOP's API is a REST API that allows you to gather data using HTTP requests in a specific format.

Typically REST APIs that allow you to gather data from users will have to follow a series of the same steps:

  • Authentication
  • Data Gathering
  • Data Processing

Authentication: Like a lot of recent APIs, WHOOP's authentication system is done through OAuth2. However, everyone's OAuth2 system is always slightly different. This would cause a hassle if you integrated with WHOOP and other OAuth2 authentication systems yourself.

Terra has abstracted this system away from you and allows you to follow a single auth flow for every provider there is. However, you were to integrate to WHOOP through OAuth2, you will have to keep track of ACCESS TOKENs and REFRESH TOKENs internally.

The user_id the parameter is linked to one user per wearable (for example, WHOOP).

Data Gathering: After authentication, you could typically request data from the REST API using the credentials retrieved (in OAuth2, this would be the Access Token). However, every company has its own access token for each user with different expiry times. Terra has abstracted this requirement away and allows you to simply request data using the user_id returned by the authentication process through Terra (regardless of the data provider company)

Now through Terra, you can request data from WHOOP's API endpoints using the user_id. If you are interested in the user's workout data, you can use the following endpoint: https://api.tryterra.co/activity

The request could be made as such:

curl --location --request GET 'https://api.tryterra.co/activity?user_id=USER_ID&start_date=2022-10-01&end_date=2022-10-30' \
--header 'dev-id: DEV-ID'
--header 'x-api-key: X-API-KEY'

This method is usually useful if you wish to retrieve historical data. If you wish to continuously receive data on update, you can open a webhook endpoint to accept Terra's webhook events. This will reduce the load on your servers to continuously make HTTP requests as well as making sure you get the most updated events from WHOOP (or any other integrations).

Data Processing: finally, after gathering the data, you will need to process it. Every REST API sends data differently; thus, you must write a parser for every datatype and wearable. Terra has again abstracted this away and only sends data in one format regardless of the data provider.

The request above returns JSON format data for the specific user_id WHOOP activity. For another company, for example, FITBIT, the only difference in this payload would be that the provider field will be FITBIT .

{
  "status": "success",
  "data": [
      "metadata": {
        "state": null,
        "upload_type": 0,
        "start_time": "2022-11-18T08:58:21.958766+00:00",
        "type": 18,
        "name": "Cross Country Skiing",
        "summary_id": "229630376069",
        "city": null,
        "country": null,
        "end_time": "2022-11-18T09:47:21.958766+00:00"
      },
      "strain_data": {
        "strain_level": 6.149371915562675
      },
      "heart_rate_data": {
        "summary": {
          "min_hr_bpm": null,
          "hr_zone_data": [
            {
              "start_percentage": 0,
              "duration_seconds": 390,
              "name": "Resting",
              "zone": 0,
              "end_percentage": 50
            },
            {
              "start_percentage": 50,
              "duration_seconds": 504,
              "name": "Very light",
              "zone": 1,
              "end_percentage": 60
            },
            ...
          ],
          "avg_hr_bpm": 118.42194006578433,
          "max_hr_bpm": 158.16932189285052,
          "avg_hrv_rmssd": null,
          "resting_hr_bpm": null,
          "avg_hrv_sdnn": null,
          "user_max_hr_bpm": null
        },
        "detailed": {
          "hr_samples": [],
          "hrv_samples_sdnn": [],
          "hrv_samples_rmssd": []
        }
      },
      "active_durations_data": {
        "activity_seconds": null,
        "inactivity_seconds": 2643.4844720203464,
        "rest_seconds": null,
        "moderate_intensity_seconds": 2101.2303060321888,
        "activity_levels_samples": [],
        "vigorous_intensity_seconds": 2342.994113043535,
        "low_intensity_seconds": 549.4035406958508,
        "num_continuous_inactive_periods": null
      },
      ...
    }
  ],
  "user": {
    "provider": "WHOOP",
    "last_webhook_update": null,
    "user_id": "013a6120-ea0f-4973-ad3b-4ac11112617e",
    "scopes": null
  },
  "type": "activity"
}

Using this data, you can take anything from WHOOP's API (and any other fitness companies' data) and display or manipulate it for special features in your app.

Continue On

This is a game changer from WHOOP's side, allowing developers to access data through their REST API. As the fitness and health sector continuously grows globally, more companies are looking to develop with fitness data. This allows them to add one more integration (rather than a big one) to their platform.

If you are integrated with Terra already, your infrastructure just got another integration overnight!


In our Integration series on WHOOP, we are discussing the data available from our API when fetching data from WHOOP.

As a reminder, the WHOOP series contains:

  • Part 1: Getting started with Rest APIs
  • Part 2: Data available from the API
  • Part 3: Integrating with Terra API
  • Part 4: Data from TERRA API

Related Articles

5 Lessons for Standing Out at HLTH

December 5, 2024

5 Lessons for Standing Out at HLTH

5 lessons from team Terra API for making a lasting impact at HLTH: from engaging senses to building real touch points, here’s what we learned from the HLTH event.

Vanessa Neeff
Strava Pulls the Plug on their API: What This Means for Developers

November 21, 2024

Strava Pulls the Plug on their API: What This Means for Developers

Strava discontinued their API service, changing the ecosystem of third-party apps that have relied on their platform. How can developers react to this?

Terra APITerra API
Alternatives to the latest changes in the Strava API

November 19, 2024

Alternatives to the latest changes in the Strava API

Strava just introduced big changes to their API program. These changes will basically kill off a lot of apps. Use Terra API instead to avoid this

Kyriakos EleftheriouKyriakos Eleftheriou

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