Whisk Docs
Whisk HomeHelp CenterDeveloper Tools
v2.0.0
v2.0.0
  • The Whisk Platform
  • Whisk API Overview
    • Introduction
    • Integration
    • Authentication
      • Server Token
      • User Access Token
        • Auth Flow Example
      • Client Token
      • Anonymous Access from Client Apps
    • Whisk Sandbox
    • Getting Started
  • Whisk API Reference 2.0
    • Provisioning
      • Get provisioning
    • Autocomplete
    • Community
      • Get your Communities
      • Get Communities from a Topic
      • Discover Recommended Communities
      • Search Communities
      • Get a Community
      • Get Recipes from a Community
      • Add Recipes to a Community
      • Remove a Recipe from a Community
      • Join a Community
      • Leave a Community
    • Posts and Reviews
      • Get reviews for a recipe
      • Create or edit review
      • Create a Post
      • Get Post by id
      • Delete a Post
      • Edit a Post
      • Report a Post
      • Create a Post Reply
      • Get Post Replies
      • Delete a Post reply
      • Report a Post reply
      • Like a Post or Reply
      • Users who liked a Post or Reply
    • Public profiles
      • Hide recipe in Public profile
      • Get Recipes for Public Profile
      • Get User's public profile by user_id
      • Get User's public profile by username
    • Custom Label
    • Feed
      • Obtain a Recipe Feed
    • Food DB
      • Autocomplete
      • Search
      • Get Food
    • Food List
    • Food Log
    • Foodpairing
    • Healthy meal recommendations
      • Healthy recipe only recommendations for DA
      • Recipe recommendations for SH
      • Tailored Plan API request for Samsung TV
    • Meal Plan
      • Generate a Meal Plan
      • Meal Object
        • Get Meals
        • Delete Meal
        • Add a Meal
      • Meal Plan Settings Object
        • Get Meal Plan Settings
        • Update Meal Plan Settings
      • Meal Plan Batch
    • Recipe
      • Get a Recipe
      • Search a Recipe
      • User Recipes & Collections
        • Add User Recipe
        • Create A Recipe
        • Update External Recipe
        • Get All User Recipes
        • Update User Recipe
        • Remove Recipe from Favorites
        • Create Collection
        • Get All User Collections
        • Get Collection
        • Get Recipes from a Collection
        • Remove Collection
        • Get Smart Collection
        • Get Recipes from a Smart Collection
    • Shopping List
      • Get your Shopping Lists
      • Get a Shopping List
      • Create a Shopping List
      • Delete a Shopping List
      • Update basic details of a Shopping List
      • Move Items between Shopping Lists
      • Add Items to a Shopping List
      • Delete an Item from a Shopping List
      • Update an Item in a Shopping List
      • Clear Items from a Shopping List
    • Media
    • Store Item
    • Unit Conversion
    • Users
      • Get a User
      • Update User Settings using Patch
      • Update User Settings using Post
    • Try it out!
  • Shopping List SDK
    • Overview
    • Examples
      • Shoppable Recipes
      • Shoppable Products
      • Shoppable Media
    • Basic Setup
      • Basic Setup
      • Methods
      • Event Listeners
      • Widget
      • Subscriptions
      • Global Configuration
      • UTM Parameters
      • Using With SPA
  • Shopping List Mobile API
    • Overview
    • Examples
    • Reference
  • API Resources
    • Authentication Scopes
    • Errors and Troubleshooting
    • Cursor Pagination
    • Limits
    • Nutrients
    • Recipe Labels
    • Filtering Recipes using Custom Labels
    • Health Score, Glycemic Index, Glycemic Load
    • Whisk User Data
    • Integrated Retailers
    • Optimizing Image Load
    • Meal Plan
Powered by GitBook
On this page

Was this helpful?

  1. Whisk API Reference 2.0

Food List

PreviousGet FoodNextFood Log

Last updated 1 year ago

Was this helpful?

Food List allows to manage the content of one's pantry supporting different storage locations and product matching.

Use-case request examples

Get foodlist including deleted (i.e. consumed) items

curl -X GET "https://api.whisk.com/foodlist/v2?filters.presence=PRESENCE_FILTER_EXISTING&filters.presence=PRESENCE_FILTER_CONSUMED&sorting.by=SORT_BY_CREATED_AT&sorting.direction=SORT_DIRECTION_DESC"  \ 
-H  "accept: application/json" \
-H  "Authorization: Bearer %USER_TOKEN%" \ 
-H  "Content-Type: application/json"

Add wine into the Wine Fridge location

Complete set of enum values forlocation andzone can be found in .

location_id allows defining in what location the item is going. For example, a user may have two wine fridges, location_id will let you distinguish them.

Whisk will validate the one item per slot rule, i.e. the API will return an error if try to put several items in the same slot.

curl -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER TOKEN%" -H  "Content-Type: application/json" -d '{
  "add":{
    "items":[
      {
        "name":"test on qa-2",
        "quantity":10,
        "unit":"l",
        "expiry_date":{
          "year":2023,
          "month":11,
          "day":2
        },
        "location":"FOOD_ITEM_LOCATION_WINE_FRIDGE",
        "location_zone_place":{
          "wine_fridge_placing":{
            "zone":"WINE_FRIDGE_LOCATION_ZONE_BOTTOM",
            "place":785
          }
        },
        "image":{
          "url":"https://whisk-res.cloudinary.com/image/upload/v1629877880/v3/user-recipes/nlddh9ajshcbgwxcawcg.jpg"
        },
        "display_name":"first test",
        "food_item_type":{
          "wine_item":{
            "wine_type":"WINE_TYPE_RED",
            "grape_type":"grape",
            "vintage":1,
            "winery":"winery",
            "country_of_origin":"UK",
            "region_of_origin":"UK",
            "body":1,
            "acidity":2,
            "tannin":1,
            "dryness":1,
            "manufacturer":"s",
            "alcohol":12,
            "score":1,
            "review_wine_graph":"string"
          }
        },
        "price":{
          "currency_code":"USD",
          "cents":"5"
        },
        "memo":"memo"
      }
    ]
  }
}'

Get wine items only from foodlist

curl -X GET "https://api.whisk.com/foodlist/v2?filters.foodItemType=FOOD_TYPE_FILTER_WINE_ITEM" \ 
-H  "accept: application/json" \
-H  "Authorization: Bearer %USER_TOKEN%" \ 
-H  "Content-Type: application/json"

Add meat specifying storage mode

curl -X POST "https://api.whisk.com/foodlist/v2/item" -H  "accept: application/json" -H  "Authorization: Bearer %USER TOKEN%" -H  "Content-Type: application/json" -d '{
  "add":{
    "items":[
      {
        "name":"Huge Steak",
        "quantity":750,
        "unit":"g",
        "expiry_date":{
          "year":2022,
          "month":9,
          "day":3
        },
        "location":"FOOD_ITEM_LOCATION_MULTIPANTRY",
        "image":{
          "url":"https://whisk-res.cloudinary.com/image/upload/v1629877880/v3/user-recipes/nlddh9ajshcbgwxcawcg.jpg"
        },
        "display_name":"Steak",
        "location_id":"user-device-id",
        "food_item_type":{
          "meat_item":{
            "meat_mode":"MEAT_MODE_AGE",
            "animal_trace_id":"123456ABCDEF",
            "country_of_origin":"KR"
          }
        },
        "price":{
          "currency_code":"USD",
          "cents":300
        },
        "memo":"My favourite farm steak to age",
        "manufactured_at":{
          "from":"1638361352",
          "to":"1638361353"
        }
      }
    ]
  }
}'

Update or remove certain fields

curl -v -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json" -d '
{
  "update":{
    "items":[
      {
        "id":"a05731b8-0c2c-4f0b-b64f-3e2b25ed04ac",
        "fields":{
          "food_item_type":{
            "wine_item":{
              "grape_type":"update",
              "vintage":1,
              "winery":"update",
              "country_of_origin":"update",
              "region_of_origin":"update",
              "body":1,
              "acidity":1,
              "tannin":1,
              "dryness":1,
              "manufacturer":"update",
              "alcohol":1,
              "score":1,
              "review_wine_graph":"update",
              "wine_id":"update",
              "wine_type":"WINE_TYPE_RED"
            }
          }
        },
        "mask":{
          "paths":[
            "name",
            "expiry_date",
            "location",
            "added_at",
            "food_item_type",
            "manufactured_at"
          ]
        }
      }
    ]
  }
}       
'

Mark an item as consumed (soft-delete)

curl -v -X POST 'https://api.whisk.com/foodlist/v2/action' -H 'Authorization: Bearer %USER_TOKEN%' 
-H "Content-Type: application/json" 
-d '{"consume": {
    "id": [
      "uuid-uuid-uuid-uuid-uuid"
    ]
  }
}'

Get recently added items

curl -X GET "https://api.whisk.com/foodlist/v2/recent?items_count=5&include_hidden_items=false" 
-H 'Authorization: Bearer %USER_TOKEN%'  

Hide items from recently added history

curl -X POST "https://api.whisk.com/foodlist/v2/recent/hide" 
-H  "Content-Type: application/json" 
-H 'Authorization: Bearer %USER_TOKEN%'  
-d '{  "ids": [    "uuid-uuid-uuid-uuid"  ]}'

Add an item directly as consumed into the Food List specifying it was AI autogenerated

  1. If UI requires some kind of grouping items together (e.g. with the same deposit date, it should be implemented on the client side)

  2. If an item with an already existing external_id is being added, we will ignore it for now. Since the API is designed as a batched one, the proper error management is tricky to add to avoid failing the whole batch of operations. While the requirements are not 100% clear it's easier to skip.

  3. All timestamp fields (e.g. added_at) are accepted and returned in Epoch seconds (not millis, sanity check is to have 10 numbers, not 13) e.g. 1691024523

curl -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json"
-d '{
  "add":{
    "items":[
      {
        "name":"orange juice",
        "quantity":1,
        "unit":"l",
        "expiry_date":{
          "year":2023,
          "month":12,
          "day":21
        },
        "location":"FOOD_ITEM_FRIDGE",
        "image":{
          "url":"https://..."
        },
        "display_name":"orange juice",
        "location_id":"string",
        "external_id":"string",
        "added_at": "1691024523",
        "consumed_at": "1691024523",
        "ai_generated": true
      }
    ]
  }
}' 

Mark items as consumed by external_id

curl -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json"
-d '{
  "consume":{
    "external_id": [
      "string"
    ],
    "consumed_at": "1691024523"
  }
}' 

Get all items added within a certain period

curl -X GET "https://api.whisk.com/foodlist/v2?filters.presence=PRESENCE_FILTER_EXISTING&filters.presence=PRESENCE_FILTER_CONSUMED&filters.added_at.from=1691024523&filters.added_at.to=1691110923&sorting.by=SORT_BY_UPDATED_AT&sorting.direction=SORT_DIRECTION_DESC" -H  "Authorization: Bearer %USER_TOKEN%" -H  "accept: application/json"

Get items consumed within a certain period

curl -X GET "https://api.whisk.com/foodlist/v2?filters.presence=PRESENCE_FILTER_CONSUMED&filters.consumed_at.from=1691024523&filters.consumed_at.to=1691110923&sorting.by=SORT_BY_UPDATED_AT&sorting.direction=SORT_DIRECTION_DESC" -H  "Authorization: Bearer %USER_TOKEN%" -H  "accept: application/json"

Unmark the item as consumed (i.e. return to existing)

curl -v -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json" -d '
{
  "update":{
    "items":[
      {
        "id":"a05731b8-0c2c-4f0b-b64f-3e2b25ed04ac",
        "fields":{
          "consumed_at":null
        },
        "mask":{
          "paths":[
            "consumed_at"
          ]
        }
      }
    ]
  }
} 
'

 

Add item as temporary out

curl -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json"
-d '{
  "add":{
    "items":[
      {
        "name":"orange juice",
        "quantity":1,
        "unit":"l",
        "expiry_date":{
          "year":2023,
          "month":12,
          "day":21
        },
        "location":"FOOD_ITEM_FRIDGE",
        "image":{
          "url":"https://..."
        },
        "display_name":"orange juice",
        "location_id":"string",
        "external_id":"string",
        "added_at": "1691024523",
        "temporary_out_at": "1691024523",
        "ai_generated": true
      }
    ]
  }
}' 

Mark item as temporary out

curl -v -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json" -d '
{
  "update":{
    "items":[
      {
        "id":"a05731b8-0c2c-4f0b-b64f-3e2b25ed04ac",
        "fields":{
          "temporary_out_at":"1691024523"
        },
        "mask":{
          "paths":[
            "temporary_out_at"
          ]
        }
      }
    ]
  }
} 
'

Mark item as presented in food list (back from temporary out)

curl -v -X POST "https://api.whisk.com/foodlist/v2/action" -H  "accept: application/json" -H  "Authorization: Bearer %USER_TOKEN%" -H  "Content-Type: application/json" -d '
{
  "update":{
    "items":[
      {
        "id":"a05731b8-0c2c-4f0b-b64f-3e2b25ed04ac",
        "fields":{
          "temporary_out_at":null
        },
        "mask":{
          "paths":[
            "temporary_out_at"
          ]
        }
      }
    ]
  }
} 
'

Request temporary out items

curl -X GET "https://api.whisk.com/foodlist/v2?filters.presence=PRESENCE_FILTER_TEMPORARY_OUT&sorting.by=SORT_BY_UPDATED_AT&sorting.direction=SORT_DIRECTION_DESC" -H  "Authorization: Bearer %USER_TOKEN%" -H  "accept: application/json"

Complete set of enum values for meat_mode can be found in .

docs
docs