Products Autocomplete

GET
/v1beta/products/autocomplete

Extra information

By default only basic information about autocomplete items is returned. To request additional metadata specify fields query parameter

GET /v1beta/products/autocomplete?language=en&fields=metadata

Images

All Autocomplete products images have are using Google magic URLs. The maximum width/height available is 900px.

A few details about this magic URL
  • By default it returns an image of a maximum length of 512px (link)
  • By appending the =sXX to the end of it where XX can be any integer in the range of 0–2560 and it will result to scale down the image to longest dimension without affecting the original aspect ratio (link=s128)
  • By appending =s0 (s zero) the original image is being returned without any resize or modification (link=s0)

Pagination

Optionally you can use pagination to get only part of a response. We use cursor-based pagination, more about it you can read here: cursor pagination.

Supported values for Metric

  • Days
  • Weeks
  • Months
  • Years
  • Infinitely
  • NotRecommended

Categories

Below is the list of all categories Whisk API supports

  • BABY CARE
  • BAKING
  • BREAD AND BAKERY
  • BREAKFAST FOODS
  • CANNED FOODS
  • CONDIMENTS
  • DAIRY AND EGGS
  • DRINKS
  • FROZEN
  • FRUITS AND VEGETABLES
  • HEALTH AND BEAUTY
  • HERBS AND SPICES
  • HOUSEHOLD
  • MEATS AND SEAFOOD
  • OTHER
  • PASTA, RICE AND BEANS
  • PET CARE
  • SNACKS

Supported language codes:

  • en (English)
  • es (Spanish)
  • fr (French)
  • ko (Korean)
  • de (German)
  • it (Italian)
  • no (Norwegian)
  • sv (Swedish)
  • zh (Chinese)
  • Note: When only language and country are passed, the endpoint returns all the data (nearly thousand of autocomplete entries). Therefore it is strongly advised to cache this data on client and periodically request incremental changes through passing modifiedSince parameter. This parameter should be extracted from response lastModified field (see response example). When it is provided, returned entries would have deletedflag, indicating if they were deleted since modifiedSince. Items with deleted: true should be removed from cache.

    GET
    /v1beta/products/autocomplete?language=en&country=GB&modifiedSince=1523006194

    Parameters

    ATTRIBUTETYPEDESCRIPTION
    language*string

    Language. Examples: en, es, ko...

    countrystring

    Country. Examples: gb, es, fr...

    qstring

    Query to filter results

    includeNonFoodboolean

    Controls including non-food items in the result

    modifiedSincelong

    Return only products which have been modified since certain time. (seconds since UNIX epoch) This field should be taken from Response object, called lastModified. When this field is provided, returned items would have deleted flag

    afterstring

    Return only products after cursor

    beforestring

    Return only products before cursor

    limitint

    It is maximum number of products that may be returned

    Sample Request

    curl "https://graph.whisk.com/v1beta/products/autocomplete?language=en&fields=metadata&modifiedSince=1522006194" \ -H "Accept: application/json" \ -H "Authorization: Token <Access-Token>"

    Response

    Sample Response

    { "lastModified": 1523006194, "products": [ { "name": "AVOCADO", "displayName": "Avocados", "imageUrl": "https://lh3.googleusercontent.com/s5CjFLsXW4FLV3p315nfBwc-0AOI4lMA399PP-qi70jGy8rfJb5UgqtCJgLdWyBpjj4PGvN7QOhJPZ_8-xZbLUgkWKY", "metadata": { "category": "FRUITS AND VEGETABLES", "storing": { "fridge": { "metric": "Days", "min": 3, "max": 4 }, "freezer": { "metric": "NotRecommended" }, "defaultLocation": "Fridge" } }, "deleted": false }, { "name": "AVOCADO", "displayName": "Avocado", "imageUrl": "https://lh3.googleusercontent.com/s5CjFLsXW4FLV3p315nfBwc-0AOI4lMA399PP-qi70jGy8rfJb5UgqtCJgLdWyBpjj4PGvN7QOhJPZ_8-xZbLUgkWKY", "metadata": { "category": "FRUITS AND VEGETABLES", "storing": { "fridge": { "metric": "Days", "min": 3, "max": 4 }, "freezer": { "metric": "NotRecommended" }, "defaultLocation": "Fridge" } }, "deleted": false }, { "name": "APPLE", "displayName": "Apples", "imageUrl": "https://lh3.googleusercontent.com/28R9ppDgH_w2A10VxvvpdeLN70y7zFbiAH4Mo1ReogSxPwU3qPRma32f7N6ZWc6doGdSA0ExcfNd9k4HN3iMAyc5ypSb", "metadata": { "category": "FRUITS AND VEGETABLES", "storing": { "pantry": { "metric": "Weeks", "min": 3, "max": 3 }, "fridge": { "metric": "Weeks", "min": 4, "max": 6 }, "freezer": { "metric": "Months", "min": 8, "max": 8 }, "defaultLocation": "Fridge" } }, "deleted": true }, { "name": "DRIED THYME", "displayName": "Thyme dry", "imageUrl": "https://lh3.googleusercontent.com/82hORAteNVxjCMrcgG4noLL4AkzQo51-4ZvoZiRWFtLpFQS0rEmqgL1DDou-5BOkji-HVgmZPK0pu3OJfbBuaELFk4M", "metadata": { "category": "HERBS AND SPICES", "storing": { "pantry": { "metric": "Years", "min": 1, "max": 2 }, "defaultLocation": "Pantry" } }, "deleted": false }, { "name": "BROCCOLI", "displayName": "Broccoli", "imageUrl": "https://lh3.googleusercontent.com/J9xWu_NPCWsEavkEQOt3xplr2F8GxMAZIQ9f4oFmkoQnoSCadrmp8pdIWgDiyhx-6XLg6OFoluTs9aLoSIxwWkqaMe5x", "metadata": { "category": "FRUITS AND VEGETABLES", "storing": { "fridge": { "metric": "Days", "min": 3, "max": 5 }, "defaultLocation": "Fridge" } }, "deleted": true } ] }