Recommendations

This resource provides a way to analyze a PersonalProfile to determine nutritional recommendations specified by various standards. At present the supported standards are the DRI (Dietary Reference Intakes), DGA (Dietary Guidelines of America), and RDI (Reference Daily Intake).

Note: The Nutrients in the response can vary by API key.

Resource URI

/recommendations

Resource Parameters

Requests to this resource require a message body containing an object that may have the following fields:

PersonalProfile Input Properties

A PersonalProfile is an object that may have any of these fields, but must specify sex, at a minimum:

Name Type Default Description
system string "DRI" Acronym for the nutrient standard to be used
("DRI", "DGA", or "RDI")
sex string
Required The biological gender of the person.
ageInMonths integer 240 The age of the person in months
ageInYears integer The age of the person in years
Ignored if ageInMonths is present 
heightInMeters number Female: 1.622, Male: 1.763  The height of the person in meters
heightInInches number

The height of the person in inches
Ignored if heightInMeters is present

weightInKilograms number Female: 74.7, Male: 88.3 The weight of the person in kilograms
weightInPounds number The weight of the person in pounds
Ignored if weightInKilograms is present
physicalActivityLevelCategory string "LowActive" The activity level of the persion
("Sedentary", "LowActive", "Active", or "VeryActive")
pregnancyDurationInWeeks integer 0 If pregnant, the number of weeks since conception.
lactationDurationInMonths integer 0 If nursing, the number of months since birth.

Resource Properties

This resource is represented as an object with the following fields:

NameTypeDescription
recommendations array of Recommendations The generated recommendations
profile PersonalProfile Result

The personal information used,
with default values, in default units

Recommendation Properties

A Recommendation is an object with most or all of the following fields:

NameTypeDescription
nutrient string The nutrient being recommended
value string The recommended value, represented as either a single number or a range.
range Range If the recommeded value is a range, this is an object representation.
unitId string The unique identifier of the recommendation unit
type string The date (in ISO 8601 format) that the food was last updated

Range Properties

A Range is an object with the following fields:

NameTypeDescription
upper number The upper endpoint of the recommended range
lower number The lower endpoint of the recommended range
upperIncluded boolean Whether the upper endpoint is included in the range
lowerIncluded boolean Whether the lower endpoint is included in the range

PersonalProfile Result Properties

A PersonalProfile Result is an object that will have all of these fields:

Name Type Description
sex string The biological gender of the person.
ageInMonths integer The age of the person in months
heightInMeters number The height of the person in meters
weightInKilograms number The weight of the person in kilograms
pregnancyDurationInWeeks integer If pregnant, the number of weeks since conception.
lactationDurationInMonths integer If nursing, the number of months since birth.

bodyMassIndex number The calculated body mass index of the person
system string The acronym of the nutrient standard used
("DRI", "DGA", or "RDI") 

Supported Operations

Generate Recommendations (HTTP POST)

HTTP POST accepts a JSON document containing the foods to be analyzed and returns a JSON document containing the results.

Example Request:

POST /recommendations?apikey=d9eea4cc28c342a2a7fc49d307860c03
Accept: application/json
Content-Type: application/vnd.com.esha.data.PersonalProfile+json

{
  "sex": "Male",
  "ageInYears": 20, 
  "system": "DGA" 
}

Example Response (truncated):

HTTP/1.1 200 OK
Content-Type: application/json

{
  "profile": {
    "sex": "Male",
    "ageInMonths": 240,
    "heightInMeters": 1.763,
    "weightInKilograms": 88.3,
    "physicalActivityLevelCategory": "LowActive",
    "pregnancyDurationInWeeks": 0,
    "lactationDurationInMonths": 0,
    "bodyMassIndex": 28.4,
    "system": "DGA"
  },
  "recommendations": [
    {
      "nutrient": "urn:uuid:7e53326a-e016-4560-ac5a-894c28e5085c",
      "value": "39.2",
      "type": "DGA",
      "unitId": "urn:uuid:d3be684c-ebfa-4861-924f-8840600d1e84"
    },
    {
      "nutrient": "urn:uuid:f763a45c-36d7-4a7a-a656-e2f1384a94e7",
      "value": "(0‥10)",
      "range": {
        "upper": 10,
        "lower": 0,
        "upperIncluded": false,
        "lowerIncluded": false
      },
      "type": "DGA",
      "unitId": "urn:uuid:a7df0af5-edb0-0002-7484-751e8eaf05c6"
    },
    ...
}