Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)
WOLFRAM LANGUAGE SERVICE CONNECTION

Fitbit

Connect your Fitbit account to the Wolfram Language to analyze Fitbit data like steps, calories, sleep, and body measurements.

Connecting & AuthenticatingConnecting & Authenticating

    ServiceConnect["Fitbit"] creates a connection to the Fitbit API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.

RequestsRequests

    ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, using parameters params. The following give possible requests.

    User Data

    Requests:

    "UserData" information about the authenticated user

    Activity

    Requests:

    "ActivityData" activity on the specified date

    Parameters:
  • "Date"(required)activity date
  • Activity Time Series

    Requests:

    "MinutesVeryActiveTimeSeries" daily number of very active minutes

    "MinutesFairlyActiveTimeSeries" daily number of fairly active minutes

    "MinutesLightlyActiveTimeSeries"  ▪  "MinutesSedentaryTimeSeries"  ▪  "MinutesVeryActivePlot"  ▪  "MinutesFairlyActivePlot"  ▪  "MinutesLightlyActivePlot"  ▪  "MinutesSedentaryPlot"

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span
  • Steps

    Requests:

    "StepsTimeSeries" daily number of steps taken

    "StepsPlot" plot of daily step totals

    "DistanceTimeSeries" daily total distance traveled

    "DistancePlot" plot of daily distance totals

    "ElevationTimeSeries"  ▪  "ElevationPlot"  ▪  "FloorsTimeSeries"  ▪  "FloorsPlot"

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span
  • Calories and Food

    Requests:

    "FoodList" list of food consumed on the specified day

    Parameters:
  • "Date"(required)date
  • Calories and Food Time Series

    Requests:

    "CaloriesTimeSeries" daily number of calories burned

    "CaloriesInTimeSeries" daily calories consumed

    "CaloriesBMRTimeSeries" daily basal metabolic rate

    "ActivityCaloriesTimeSeries" daily calories burned during activities

    "CaloriesPlot"  ▪  "CaloriesInPlot"  ▪  "CaloriesBMRPlot"  ▪  "ActivityCaloriesPlot"  ▪  "WaterTimeSeries"  ▪  "WaterPlot"

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span
  • Sleep

    Requests:

    "SleepData" sleep details for a given date

    Parameters:
  • "Date"(required)date
  • Sleep Time Series

    "SleepCalendar" a plot showing the user's sleep schedule and efficiency

    "SleepDensityTimeline" a 24-hour timeline showing the user's sleep pattern

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span
  • Sleep Time Series

    "MinutesAsleepTimeSeries" daily minutes of sleep

    "MinutesAwakeTimeSeries" minutes spent awake in bed

    "TimeInBedTimeSeries" daily time spent in bed

    "SleepEfficiencyTimeSeries" daily sleep efficiency

    "BedTimes" a list of sleep starting times

    "MinutesAsleepPlot"  ▪  "MinutesAwakePlot"  ▪  "TimeInBedPlot"  ▪  "SleepEfficiencyPlot"  ▪  "AwakeningsCountTimeSeries"  ▪  "AwakeningsCountPlot"  ▪  "MinutesAfterWakeupTimeSeries"  ▪  "MinutesAfterWakeupPlot"  ▪  "MinutesToFallAsleepTimeSeries"  ▪  "MinutesToFallAsleepPlot"  ▪  "SleepList"

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span
  • Record Weight

    Requests:

    "RecordWeight" post a weight measurement

    Parameters:
  • "Date"(required)date
    "Weight"(required)users weight
  • Body Measurements Time Series

    Requests:

    "WeightTimeSeries" daily weight measurements

    "BMITimeSeries" daily body mass index calculation

    "BodyFatTimeSeries" daily body fat percentage

    "WeightPlot"  ▪  "BMIPlot"  ▪  "BodyFatPlot"

    Parameters:
  • "StartDate"(required)beginning of time span
    "EndDate"(required)end of time span

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Create a new connection by launching an authentication dialog:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Plot the total steps for each day in a range:

In[3]:=
Click for copyable input
Out[3]=

Get a time series of daily calories burned:

In[4]:=
Click for copyable input
Out[4]=

Create a moving average:

In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=