foodGroups

Get a food group

Return a single food group by its canonical code, or a 404 if unknown.

Supports sparse fieldsets via fields[food-groups].

get/v1/food-groups/{id}

Request

  • Base URL: https://api.noms.sh
  • URL: https://api.noms.sh/v1/food-groups/{id}
  • Auth: API key in header X-API-Key

Path parameters

idstring required

Canonical food-group code (UPPER_SNAKE, e.g. DAIRY).

Example:DAIRY

Query parameters

fields[food-groups]string

Sparse fieldset. A comma-separated subset of food-groups fields to return (e.g. id,name). Omit to return all fields.

Headers

If-None-Matchstring

An ETag from a previous response for this URL. If it still matches, the API answers 304 Not Modified with no body; otherwise you get the full 200. Either way the request is metered.

Response

A single food group. fields[food-groups] may trim the keys present in data.

Example response

{
  "data": {
    "icon_url": "https://images.noms.sh/dairy-icon-hash",
    "id": "DAIRY",
    "name": "Dairy"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.