Food

This resource provides a view of a particular food.

Resource URI

/food/{uri}

Resource Path Parameter

This resource requires replacement of the {uri} parameter in the path, with the URI of the food to be retrieved.

Resource Properties

This resource is represented as an object that will always have the following fields:

NameTypeDescription
id string The food's URI
description string The description of the food
quantity number The base quantity for this food
unit string The URI of the base unit for this food
nutrient_data array of Nutrient Data Point The available nutrient/value pairs for this food that are allowed for the APIKEY used
units array of strings The URIs for the Food Units that are valid for this food

modified string The YYYY-MM-DD date that this food was last modified
discontinued boolean Flag identifying whether the food has been discontinued in the database

The resource object may also include the following fields:

NameTypeDescription
group string The food-type name this food is associated with 
product string The product name associated with this food
supplier string The supplier name associated with this food

Nutrient Data Point Properties

A Nutrient Data Point is an object with the following fields:

NameTypeDescription
nutrient string The unique identifier of the Nutrient
value number The nutrient value

Supported Operations

Search Foods (HTTP GET)

HTTP GET returns a JSON document containing the specified food information.

Example Request

GET /food/urn:uuid:17dbb668-f3f4-4822-8566-f46496887edc
Accept: application/json

Example Response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "id": "urn:uuid:17dbb668-f3f4-4822-8566-f46496887edc",
  "description": "broccoli, fresh",
  "quantity": 0.5,
  "unit": "urn:uuid:dfad1d25-17ff-4201-bba0-0711e8b88c65",
  "product": "USDA",
  "supplier": "USDA SR-27",
  "nutrient_data": [
    {
      "nutrient": "urn:uuid:a4d01e46-5df2-4cb3-ad2c-6b438e79e5b9",
      "value": 15.47
    }
  ],
  "units": [
    "urn:uuid:e1d79375-15db-4ed7-8ead-f64dc2319091",
    "urn:uuid:9eda6d41-4fbb-4a97-b046-46aee8a086de",
    "urn:uuid:c2a18c35-f4e7-4297-b8de-1e0f1bd16cfb",
    "urn:uuid:1c8d43b3-6b19-43ab-95f0-803a37fdf4f1",
    "urn:uuid:dfad1d25-17ff-4201-bba0-0711e8b88c65",
    "urn:uuid:e0ad190a-d48b-443e-b637-e1cf05db2cdb",
    "urn:uuid:3e8384f0-ea47-4fde-b7e1-a12747b28a30",
    "urn:uuid:d3be684c-ebfa-4861-924f-8840600d1e84",
    "urn:uuid:0e5f4dd2-3353-477f-9773-0ed116c93e2e",
    "urn:uuid:20346378-1e1f-4d65-8833-6119228e8639",
    "urn:uuid:a5b9f8c0-77fb-40c0-9018-43678710f8e7",
    "urn:uuid:96b8744b-6db7-4448-b1fb-63a2c8695a0e",
    "urn:uuid:4579233c-4dcd-46f6-a0ec-e2ff289068e4",
    "urn:uuid:3f2f0bb4-d5b2-4edd-be04-5371c666c3c2",
    "urn:uuid:7c43861a-2df6-46bc-ab49-e831f767d69e"
  ],
  "modified": "2014-09-10",
  "discontinued": false
}