Nutrition
GET: https://api.validic.com/v1/organizations/{organization_id}/users/{user_id}/nutrition.json
Activities related to calorie intake, consumption, and nutritional information (such as fat, protein, carbohydrates, sodium, etc.)
Nutrition URLS
GET /v1/organizations/:organization_id/nutrition
GET /v1/organizations/:organization_id/nutrition/latest
GET /v1/organizations/:organization_id/users/:user_id/nutrition
GET /v1/organizations/:organization_id/users/:user_id/nutrition/latest
Nutrition Short URLS
GET /v1/nutrition/latest(.:format)
GET /v1/nutrition(.:format)
Parameters
The following section displays the parameters used to retrieve data.
Request
HTTP
GET https://api.validic.com/v1/organizations/5400864SAMPLEd683000004/nutrition/latest.json?access_token=9ff1217aSAMPLE689a3e2fce700de97387920bfaabddc871604a277cb901b2&start_date=2015-10-01T08:44:29Z&end_date=2015-12-03T08:54:27Z&limit=200
Results
200401
{
"summary":{
"status":200,
"message":"Ok",
"results":332,
"start_date":"2015-12-01T08:44:29+00:00",
"end_date":"2015-12-03T08:54:27+00:00",
"offset":0,
"limit":200,
"previous":null,
"next":"https://api.validic.com/v1/organizations/5400864SAMPLEd683000004/nutrition/latest?access_token=9ff1217aSAMPLE689a3e2fce700de97387920bfaabddc871604a277cb901b2&end_date=2015-12-03T08%3A54%3A27Z&limit=200&page=2&start_date=2015-12-01T08%3A44%3A29Z",
"params":{
"start_date":"2015-12-01T08:44:29+00:00",
"end_date":"2015-12-03T08:54:27+00:00",
"offset":0,
"limit":200
}
},
"nutrition":[
{
"_id":"5660012868d4SAMPLE066f39",
"calories":567.0,
"carbohydrates":44.7,
"fat":30.7,
"fiber":4.7,
"last_updated":"2015-12-03T08:45:28+00:00",
"meal":"Burrito",
"protein":32.7,
"sodium":1507.4,
"source":"fitbit",
"source_name":"Fitbit",
"timestamp":"2015-12-01T08:00:00+00:00",
"user_id":"53bb08718462SAMPLE000013",
"utc_offset":"-08:00",
"validated":false,
"water":null
},
{
"_id":"56600127ab56SAMPLE616fe",
"calories":500.0,
"carbohydrates":102.5,
"fat":2.5,
"fiber":5.0,
"last_updated":"2015-12-03T08:45:27+00:00",
"meal":"Pasta",
"protein":17.5,
"sodium":0.0,
"source":"fitbit",
"source_name":"Fitbit",
"timestamp":"2015-12-01T08:00:00+00:00",
"user_id":"53bb087184626bSAMPLE013",
"utc_offset":"-08:00",
"validated":false,
"water":null
}
]
}
Return Values
The following values are included in a standard response. Expanded data varies by source. You can locate a complete list of expanded fields here.
Return Value | Type | Description |
---|---|---|
timestamp | String | Timestamp for the measurement set |
utc_offset | String | Timezone information for the measurement set |
calories | Double | The value of the measured quantity in kilocalories (Calories) |
carbohydrates | Double | The value of the measured quantity in g |
fat | Double | The value of the measured quantity in g |
fiber | Double | The value of the measured quantity in g |
protein | Double | The value of the measured quantity in g |
sodium | Double | The value of the measured quantity in mg |
water | Double | The value of the measured quantity in mL |
meal | String | The meal, for example: pizza, Coke, chicken breast, other, unspecified |
source | String | The short name of the application that recorded the activity |
source_name | String | The display name of the application that recorded the activity |
last_updated | String | Date and time when the measurement set was last updated |
_id | String | Unique identifier of the entry |
validated | Boolean | Value indicates the data you are receiving was generated using a device, opposed to being manually entered by an end user |
Additional Examples
Filter by date and expanded
GET https://api.validic.com/v1/organizations/{ORGANIZATION_ID}/users/{USER_ID}/nutrition.json?access_token={ORGANIZATION_ACCESS_TOKEN}&start_date=2015-09-01T00:00:00+00:00&end_date=2015-09-30T23:59:59+00:00&expanded=1
Filter by Source
Start Date of Activity