Get Food
Retrieves the details of a specific food stored in the Fitbit food database or a private food the authorized user has entered.
Scope: nutrition
Request
GET | /1/foods/[food-id].json |
URI Arguments
food-id | required | The ID of the food |
Request Headers
authorization | required | Specify the token type and Fitbit user’s access token. Token type: Bearer |
accept | optional | The media type of the response content the client is expecting. Supported: application/json |
accept-language | optional | The measurement unit system to use for response values. See Localization. |
accept-locale | optional | The locale to use for response values. See Localization. |
Examples
GET https://api.fitbit.com/1/foods/17877.json
curl -X GET "https://api.fitbit.com/1/foods/17877.json" \
-H "accept: application/json" \
-H "authorization: Bearer <access_token>"
-H "accept: application/json" \
-H "authorization: Bearer <access_token>"
Response
Element Name | Description |
food : accessLevel | |
food : brand | |
food : calories | |
food : defaultServingSize | |
food : defaultUnit : id | |
food : defaultUnit : name | |
food : defaultUnit : plural | |
food : foodId | |
food : isGeneric | |
food : locale | |
food : name | |
food : servings : multiplier | |
food : servings : servingSize | |
food : servings : unit : id | |
food : servings : unit : name | |
food : servings : unit : plural | |
food : servings : unitId | |
food : units |
{ "food": { "accessLevel": "PUBLIC", "brand": "", "calories": 79, "defaultServingSize": 1, "defaultUnit": { "id": 91, "name": "cup", "plural": "cups" }, "foodId": 17877, "isGeneric": false, "locale": "en_US", "name": "Blueberry, Unsweetened, Frozen", "servings": [ { "multiplier": 1, "servingSize": 1, "unit": { "id": 91, "name": "cup", "plural": "cups" }, "unitId": 91 }, { "multiplier": 2, "servingSize": 1, "unit": { "id": 256, "name": "pint", "plural": "pints" }, "unitId": 256 }, { "multiplier": 4, "servingSize": 1, "unit": { "id": 279, "name": "quart", "plural": "quarts" }, "unitId": 279 }, { "multiplier": 3.658064603805542, "servingSize": 20, "unit": { "id": 226, "name": "oz", "plural": "oz" }, "unitId": 226 }, { "multiplier": 2.9264516830444336, "servingSize": 1, "unit": { "id": 180, "name": "lb", "plural": "lbs" }, "unitId": 180 }, { "multiplier": 0.6451612710952759, "servingSize": 100, "unit": { "id": 147, "name": "gram", "plural": "grams" }, "unitId": 147 }, { "multiplier": 6.45172119140625, "servingSize": 1, "unit": { "id": 389, "name": "kg", "plural": "kg" }, "unitId": 389 } ], "units": [ 91, 256, 279, 226, 180, 147, 389 ] } }
Response Headers
content-type | The media type of the response content being sent to the client. Supported: application/json |
fitbit-rate-limit-limit | The quota number of calls. |
fitbit-rate-limit-remaining | The number of calls remaining before hitting the rate limit. |
fitbit-rate-limit-reset | The number of seconds until the rate limit resets. |
Note: The rate limit headers are approximate and asynchronously updated. This means that there may be a minor delay in the decrementing of remaining requests. This could result in your application receiving an unexpected 429 response if you don't track the total number of requests you make yourself.
Response Type
HTTP Status Code | HTTP response code. List of codes are found in the Troubleshooting Guide. |
Status Message | Description of the status code. |
Response Body | Contains the JSON response to the API call. When errors are returned by the API call, the errorType, fieldName and message text will provide more information to the cause of the failure. |
Response Codes
200 | A successful request. |
400 | The request had bad syntax or was inherently impossible to be satisfied. |
401 | The request requires user authentication. |
Note: For a complete list of response codes, please refer to the Troubleshooting Guide.
Additional Information
Nutritional values are currently included in responses, but only for PRIVATE foods.