Units

The nutrient profile for a particular Food or Recommendation depends on the unit in which its quantity is expressed. Because the units available for a particular food can vary, this resource provides a listing of all Units supported by the API.

Resource URI

/units

Resource Properties

This resource is represented as an array of objects with the following fields:

NameTypeDescription
id string The unique identifier of the unit
description string A human-readable description of the unit
abbr string A human-readable abbreviation for the unit

Supported Operations

List Units (HTTP GET)

HTTP GET returns a JSON document containing all supported units.

Example Request

GET /units?apikey=d9eea4cc28c342a2a7fc49d307860c03
Accept: application/json

Example Response

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

[
  {
    "id": "urn:uuid:c2a18c35-f4e7-4297-b8de-1e0f1bd16cfb",
    "description": "Teaspoon",
    "abbr": "tsp" 
  },
  {
    "id": "urn:uuid:1c8d43b3-6b19-43ab-95f0-803a37fdf4f1",
    "description": "Tablespoon",
    "abbr": "Tbs" 
  },
  {
    "id": "urn:uuid:dfad1d25-17ff-4201-bba0-0711e8b88c65",
    "description": "Cup",
    "abbr": "c" 
  },
  ...
]