NutraCheck Integration

With our nutracheck Integration you can access activity, nutrition data all within one single integration using Terra. Below are key steps to allow you to integrate your application with nutracheck

1. What you need to integrate with NutraCheck

  • Terra API Key
    Once you sign up, we will provide you with an API key which will allow you to access our API

  • Developer ID
    We will provide you with a Developer ID, which allows Terra to identify users that belong to you, and associate API traffic to you.

  • Callback/Webhook URL
    You will need to set up a server (or use a testing environment like https://webhook.site) that accepts POST requests from Terra.

2. Data format

All data is sent to your webhook in JSON format in the form of 5 different types of payloads: Activity, Athlete, Body, Daily, Sleep, Menstruation; depending on your needs, you may select a subset of the aforementioned, and request less data from your users.

Examples of data payloads can be found here. If you would only like to receive specific fields out of the ones available, you may also select only the ones relevant to your needs and omit the rest. The following is an example of the data payload you may expect from an activity coming from Terra.

{
    "oxygen_data": {
        "saturation_percentage": 95,
        "max_volume_ml_per_min_per_kg": 45,
        "saturation_samples": [
            {
                "timestamp":"2021-03-21T04:00:00-07:00",
                "percentage": 97,
            },
        ]
    },
    "energy_data": {
        "energy_kilojoules": 100,
        "energy_planned_kilojoules": 100
    },
    "strain_data": {
        "strain_level": 57
    },
    "power_data": {
        "avg_watts": 210.0,
        "power_samples": [
            {
                "timestamp":"2021-03-21T04:00:00-07:00",
                "watts": 210.0,
                "timer_duration_seconds": 10
            },
            {
                "timestamp":"2021-03-21T04:05:00-07:00",
                "watts": 210.0,
                "timer_duration_seconds": 20
            }
        ],
        "max_watts": 220.1,
    },
    "MET_data": {
        "num_moderate_intensity_minutes": 213,
        "num_low_intensity_minutes": 13,
        "avg_level": 1.425,
        "samples": [
            {
                "timestamp":"2021-03-21T04:10:00-07:00",
                "level":0.9
            },
            {
                "timestamp":"2021-03-21T04:02:00-07:00",
                "level":0.9
            }
        ],
        "num_high_intensity_minutes": 423,
        "num_inactive_minutes": 40
    },
    "polyline_map_data": {
        "summary_polyline": "adf"
    },
    "heart_rate_data": {
        "summary": {
            "user_hr_max": 190,
            "min_hr": 60,
            "avg_hr_variability": 65,
            "avg_hr": 70,
            "resting_hr": 60,
            "max_hr": 80
        },
        "detailed": {
            "hrv_samples": [
                {
                    "timestamp":"2021-03-21T04:01:00-07:00",
                    "hrv":65
                },
                {
                    "timestamp":"2021-03-21T04:02:00-07:00",
                    "hrv":65
                }
            ],
            "hr_samples": [
                {
                    "timestamp":"2021-03-21T04:01:00-07:00",
                    "bpm": 70
                },
                {
                    "timestamp":"2021-03-21T04:02:00-07:00",
                    "bpm": 71
                },
            ]
        }
    },
    "active_durations_data": {
        "activity_seconds": 120,
        "low_intensity_seconds": 90,
        "rest_seconds": 1230,
        "num_continuous_inactive_periods": 4,
        "inactivity_seconds": 49,
        "activity_levels_samples": [
            {
                "timestamp":"2021-03-21T04:00:00-07:00",
                "activity_level":2
            },
            {
                "timestamp":"2021-03-21T04:02:00-07:00",
                "activity_level":2
            }
        ],
        "moderate_intensity_seconds": 500,
        "vigorous_intensity_seconds": 700
    },
    "movement_data": {
        "normalized_speed_metres_per_second": 4.05,
        "avg_torque_newton_metres": 8,
        "avg_pace_minutes_per_kilometre": 5.12,
        "max_pace_minutes_per_kilometre": 6.05,
        "max_speed_metres_per_second": 4.27,
        "avg_cadence": 78,
        "max_cadence": 78,
        "avg_velocity_metres_per_second": 3,
        "max_torque_newton_metres": 10,
        "avg_speed_metres_per_second": 3.26,
        "max_velocity_metres_per_second": 4
    },
    "metadata": {
        "city": "London",
        "type": 17,
        "end_time": "2021-03-21T04:50:00-07:00",
        "start_time": "2021-03-21T04:00:00-07:00",
        "country": "United Kingdom",
        "name": "Spinning",
        "summary_id": "10934852405973",
        "upload_type": 1,
        "state": "None"
    },
    "TSS_data": {
        "samples": [
            {
                "intensity_factor_planned":80,
                "intensity_factor_actual":89.94437,
                "method":"HR",
                "planned": 80.0,
                "actual":89.9443,
                "normalized_power_watts":200
            }
        ]
    },
    "device_data": {
        "software_version": "1.12.36",
        "manufacturer": "Suunto",
        "serial_number": "1234567898765",
        "name":"Suunto Spartan Sport Wrist HR",
        "hardware_version": "LankkuD"
    },
    "work_data": {
        "work_in_kilojoules": null
    },
    "distance_data": {
        "summary": {
            "floors_climbed": 1000,
            "swimming": {
                "pool_length_metres": 25,
                "num_laps": 35,
                "num_strokes": 493
            },
            "elevation": {
                "gain_actual_metres": 28.7,
                "avg_metres": 1.23,
                "loss_actual_metres": 5.0,
                "max_metres": 40.0,
                "gain_planned_metres": 36.7,
                "min_metres": 28.0
            },
            "distance_metres": 1203,
            "steps": 10200
        },
        "detailed": {
            "elevation_samples": [
                {    
                    "timestamp":"2021-03-21T04:00:00-07:00",
                    "elev_metres": 109.4000244140625,
                    "timer_duration_seconds": 20
                },
                {    
                    "timestamp":"2021-03-21T04:07:00-07:00",
                    "elev_metres": 149.4123244140625,
                    "timer_duration_seconds": 30
                }
            ],
            "distance_samples": []
        }
    },
    "calories_data": {
        "net_intake_calories": 2300,
        "net_activity_calories": 700,
        "BMR_calories": 2100,
        "total_burned_calories": 2800
    },
    "position_data": {
        "start_pos_lat_lng": [-0.061000000000000006, 51.531135],
        "position_samples": [
            {
                "timestamp":"2021-03-21T04:00:00-07:00",
                "coords_lat_lng": [51.053232522681355, -114.06880217604339],
                "timer_duration_seconds": 20
            },
            {
                "timestamp":"2021-03-21T04:05:00-07:00",
                "coords_lat_lng": [51.053232522681355, -114.06880217604339],
                "timer_duration_seconds": 10
            }
        ],
        "centre_pos_lat_lng": [-0.04478833333333333, 51.53568],
        "end_pos_lat_lng": [-0.04478833333333333, 51.53568],
    }
}

3. Receiving data for your NutraCheck integration - WEBHOOKS

Our infrastructure revolves around webhooks. When setting up your Terra account, you will be prompted to provide a callback URL, to which Terra may send data using POST requests.

Your NutraCheck integration with Terra supports periodic delivery of data without needing to request it yourself. NutraCheck will be polled regularly based on your chosen webhook event frequency, following which we POST the normalized data to your webhook URL.

4. Requesting data for your NutraCheck integration - HTTP

You may also use HTTP requests with your NutraCheck integration in case you wish to request historical data or data over extended periods of time.

Most HTTP endpoints can take additional parameters -start_date and end_date- which allow you to request for data over a specific period for the given user.

5. Front end - end user experience

We provide a front end solution for your end users to authenticate with Terra and be linked back to your webhook URL through your Terra developer ID.

widget mockup peloton loginwidget mockup

In order to use the widget integration, simply open a browser within your app pointing to https://widget.tryterra.co after creating a widget session. See the documentation for further information and instructions on how to integrate with our widget.

Any user following through with authentication using the above will be linked back to your Terra developer account.

Product

API

Widget

SDK

Status

Documentation

Dashboard

Pricing

Support

Contact us

GDPR

Privacy Policy

Cookies Policy

Terms of Pruchase

Company

Careers

Blog

About

Customers