Title: | Scrapes Data from Fitbit |
Version: | 0.1.8 |
Author: | Cory Nissen <corynissen@gmail.com> [aut, cre] |
Maintainer: | Cory Nissen <corynissen@gmail.com> |
Description: | Scrapes data from Fitbit http://www.fitbit.com. This does not use the official API, but instead uses the API that the web dashboard uses to generate the graphs displayed on the dashboard after login at http://www.fitbit.com. |
Depends: | R (≥ 3.0.0) |
License: | MIT + file LICENSE |
LazyData: | true |
Imports: | httr, stringr, jsonlite, methods, utils |
URL: | https://github.com/corynissen/fitbitScraper |
RoxygenNote: | 6.0.1 |
Suggests: | knitr, rmarkdown, ggplot2, ggthemes |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2017-04-13 15:19:10 UTC; 60018847 |
Repository: | CRAN |
Date/Publication: | 2017-04-13 22:12:40 UTC |
Get activity data from fitbit.com
Description
Get activity data from fitbit using cookie returned from login function
Usage
get_activity_data(cookie, end_date)
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
end_date |
Date in YYYY-MM-DD format |
Value
A dataframe with raw output from Fitbit
Examples
## Not run:
get_activity_data(cookie, end_date="2015-01-20")
## End(Not run)
get_activity_data
Get daily data from fitbit.com
Description
Get daily data from fitbit using cookie returned from login function
Usage
get_daily_data(cookie, what = "steps", start_date, end_date)
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
what |
What data you wish to be returned. Options include "steps", "distance", "floors", "minutesVery", "caloriesBurnedVsIntake", "minutesSedentary", "getTimeInHeartRateZonesPerDay", "getRestingHeartRateData" |
start_date |
Date in YYYY-MM-DD format |
end_date |
Date in YYYY-MM-DD format |
Value
A dataframe with two columns:
time |
A POSIXct time value |
data |
The data column corresponding to the choice of "what" |
Examples
## Not run:
get_daily_data(cookie, what="steps", start_date="2015-01-13", end_date="2015-01-20")
## End(Not run)
get_daily_data
Get intraday data from fitbit.com
Description
Get intraday data from fitbit using cookie returned from login function
Usage
get_intraday_data(cookie, what = "steps", date)
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
what |
What data you wish to be returned. Options include "steps", "distance", "floors", "active-minutes", "calories-burned", "heart-rate" |
date |
Date in YYYY-MM-DD format |
Value
A dataframe with two columns:
time |
A POSIXct time value |
data |
The data column corresponding to the choice of "what" |
Examples
## Not run:
get_intraday_data(cookie, what="steps", date="2015-01-20")
## End(Not run)
get_intraday_data
Get official data export from fitbit.com premium
Description
Get official data export from fitbit premium using cookie returned from login function. This should be used over individual calls to get_daily_data(), etc. if you subscribe to premium and data export is allowed. I'm not subscribed to premium, but it works for me...
Usage
get_premium_export(cookie, what = "ACTIVITIES", start_date = "2015-01-13",
end_date = "2015-01-20")
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
what |
What data you wish to be returned. Options include "BODY", "FOODS", "ACTIVITIES", "SLEEP" |
start_date |
Date in YYYY-MM-DD format |
end_date |
Date in YYYY-MM-DD format |
Value
A list with two things
summary |
A list of sleep summary values |
df |
A data frame containing various sleep values over time |
Examples
## Not run:
get_premium_export(cookie, what="ACTIVITIES", start_date="2015-01-13", end_date="2015-01-20")
## End(Not run)
get_premium_export
Get sleep data from fitbit.com
Description
Get sleep data from fitbit using cookie returned from login function
Usage
get_sleep_data(cookie, start_date = "2015-01-13", end_date = "2015-01-20")
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
start_date |
Date in YYYY-MM-DD format |
end_date |
Date in YYYY-MM-DD format |
Value
A list with two things
summary |
A list of sleep summary values |
df |
A data frame containing various sleep values over time |
Examples
## Not run:
get_sleep_data(cookie, start_date="2015-01-13", end_date="2015-01-20")
## End(Not run)
get_sleep_data
Get weight data from fitbit.com
Description
Get weight data from fitbit using cookie returned from login function
Usage
get_weight_data(cookie, start_date, end_date)
Arguments
cookie |
Cookie returned after login, specifically the "u" cookie |
start_date |
Date in YYYY-MM-DD format |
end_date |
Date in YYYY-MM-DD format |
Value
A dataframe with two columns:
time |
A POSIXct time value |
weight |
The data column corresponding to weight |
Examples
## Not run:
get_weight_data(cookie, start_date="2015-01-13", end_date="2015-01-20")
## End(Not run)
get_weight_data
Login to fitbit.com and get cookie
Description
Get the login cookie after login at www.fitbit.com
Usage
login(email, password, rememberMe = FALSE)
Arguments
email |
Email address used to login to fitbit.com |
password |
Password used to login to fitbit.com |
rememberMe |
Value for rememberMe during login, default is FALSE, but changing to TRUE may help with login issues |
Value
A string containing the cookie that is returned after login at www.fitbit.com
Examples
## Not run:
cookie <- login(email="corynissen<at>gmail.com", password="mypasswordhere")
## End(Not run)
login