The Google Health API provides data types for tracking a user's food intake and nutritional information. These types allow you to log meals, reference foods from the food database, and track nutrient quantities.
Supported data types
Data typedataType
filter parameter |
Record type |
Available operations |
Scope | Webhook support |
True zeros support |
|---|---|---|---|---|---|
Food
foodfood
|
Food | list, get | .nutrition.readonly.nutrition.writeonly |
||
Food Measurement Unit
food-measurement-unitfood_measurement_unit
|
Food | list, get | .nutrition.readonly.nutrition.writeonly |
||
Nutrition Log
nutrition-lognutrition_log
|
Sample | list, get, reconcile, rollup, dailyRollup, create, update, batchDelete | .nutrition.readonly.nutrition.writeonly |
Nutrition Log
A Nutrition Log represents food logged by a user. There are two ways to create a nutrition log, depending on the food type:
Identified food: Set the
foodfield to reference an existing Food resource. Thenutrients,energy,energyFromFat,totalCarbohydrate,totalFat, andfoodDisplayNamefields are populated automatically from the referenced food. This is the preferred method.Anonymous food: Set the
foodDisplayNamefield manually and provide values fornutrients,energy,energyFromFat,totalCarbohydrate, andtotalFat. Nutrition logs created from anonymous food are not editable after creation.
Create a nutrition log with anonymous food
To create a nutrition log entry, send a POST request to the nutrition-log
data points endpoint.
Request
POST https://health.googleapis.com/v4/users/me/dataTypes/nutrition-log/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"nutritionLog": {
"interval": {
"startTime": "2026-06-16T18:00:00Z",
"endTime": "2026-06-16T18:30:00Z"
},
"foodDisplayName": "Grilled Chicken Breast",
"mealType": "DINNER",
"energy": {
"kcal": 165
},
"totalCarbohydrate": {
"grams": 0
},
"totalFat": {
"grams": 3.6
},
"nutrients": [
{
"nutrient": "PROTEIN",
"quantity": {
"grams": 31
}
},
{
"nutrient": "SODIUM",
"quantity": {
"grams": 0.074
}
}
],
"serving": {
"amount": 1.0
}
}
}Response
{
"done": true,
"response": {
"@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
"name": "users/user-id/dataTypes/nutrition-log/dataPoints/data-point-id",
"dataSource": {
"recordingMethod": "UNKNOWN",
"application": {
"googleWebClientId": "google-web-client-id"
},
"platform": "GOOGLE_WEB_API"
},
"nutritionLog": {
"interval": {
"startTime": "2026-06-16T18:00:00Z",
"startUtcOffset": "0s",
"endTime": "2026-06-16T18:30:00Z",
"endUtcOffset": "0s",
"civilStartTime": {
"date": {
"year": 2026,
"month": 6,
"day": 16
},
"time": {
"hours": 18
}
},
"civilEndTime": {
"date": {
"year": 2026,
"month": 6,
"day": 16
},
"time": {
"hours": 18,
"minutes": 30
}
}
},
"energy": {
"kcal": 165
},
"totalCarbohydrate": {
"grams": 0
},
"totalFat": {
"grams": 3.6
},
"nutrients": [
{
"quantity": {
"grams": 31
},
"nutrient": "PROTEIN"
},
{
"quantity": {
"grams": 0.074
},
"nutrient": "SODIUM"
}
],
"mealType": "DINNER",
"serving": {
"amount": 1
},
"foodDisplayName": "Grilled Chicken Breast"
}
}
}Create a nutrition log with identified food
To log a food item from the food database, set the food field to reference a
Food resource. The API populates nutritional fields automatically.
Request:
POST https://health.googleapis.com/v4/users/me/dataTypes/nutrition-log/dataPoints
Authorization: Bearer access-token
Content-Type: application/json
{
"nutritionLog": {
"interval": {
"startTime": "2026-06-16T12:00:00Z",
"endTime": "2026-06-16T12:30:00Z"
},
"food": "users/me/dataTypes/food/dataPoints/food-id",
"mealType": "LUNCH",
"serving": {
"amount": 1.0
}
}
}Delete nutrition logs
To delete one or more nutrition log entries, send a POST request to the
batchDelete endpoint with the resource names of the entries to remove.
Request:
POST https://health.googleapis.com/v4/users/me/dataTypes/nutrition-log/dataPoints:batchDelete
Authorization: Bearer access-token
Content-Type: application/json
{
"names": [
"users/me/dataTypes/nutrition-log/dataPoints/data-point-id"
]
}NutritionLog fields
For a complete list of fields and descriptions, see the Reference Documentation.
EnergyQuantity
Represents an energy measurement, measured in kilocalories (kcal). For details, see EnergyQuantity.
{
"kcal": 165
}
WeightQuantity
Represents a weight measurement, measured in grams. For details, see WeightQuantity.
{
"grams": 27.3
}
NutrientQuantity
Represents a specific nutrient and its measured quantity. For details, see NutrientQuantity.
{
"nutrient": "PROTEIN",
"quantity": {
"grams": 31
}
}
Nutrient values
For a complete list of supported nutrient types, see Nutrient.
Serving
Represents the serving information for a nutrition log entry. For details, see Serving.
{
"amount": 1.5
}
MealType values
For a complete list of supported meal types, see MealType.
Food
Food is a read-only data type that represents a food item in the food database.
Use the list and get operations to browse available foods and retrieve their
nutritional information.
List foods
To list foods, send a GET request to the food data points endpoint:
GET https://health.googleapis.com/v4/users/me/dataTypes/food/dataPoints Authorization: Bearer access-token Accept: application/json
Food Measurement Unit
Food Measurement Unit is a read-only data type that represents measurement units used for food servings (for example, "cup", "tablespoon", or "piece").
List available measurement units
To list available measurement units:
GET https://health.googleapis.com/v4/users/me/dataTypes/food-measurement-unit/dataPoints Authorization: Bearer access-token Accept: application/json
Guidelines
- Use identified food when possible. The API populates nutritional fields automatically, reducing errors and ensuring consistency with the food database.
- Nutrition logs created from anonymous food cannot be updated after creation. If you need to correct an anonymous food log, delete it and create a new one.
- All nutrient quantities in the
nutrientsarray use grams as the unit of measurement. - The
energyandenergyFromFatfields use kilocalories (kcal) as the unit of measurement.