Search a Recipe
A method to search recipes.
Recipe Search
POST
https://api.whisk.com/recipe/v2/search
Request Body
Search Request
object
Logic for A/B was temporarily disabled. It could be enabled again by request
Internal logic on whisk back-end was updated for this endpoint. Implicit profile functionality and A/B test were implemented.
For ST Cooking user_id
for which embeddings were uploaded, search results will be generated by elastic Search according to corresponded embedding.
A/B test was added on the BE. Users splitted by murmurHash2 (64)
into 2 groups:
Provide results with implicit profile functionality
Provide results without implicit profile functionality
So for first group embeddings should be added for only first group while call method = 'whisk.api.recipe.v2.RecipeAPI/SearchRecipes'
The Search API accepts a query object that looks similar to this:
It is made up of the following attributes:
ATTRIBUTE
TYPE
DESCRIPTION
query
string
Search phrase
language
string
recipes should be in this language, it allows only ISO 639-1 language codes Default value: en
minIngredientsShouldMatch
int
if includeIngredients specified, number of minimum ingredients, which should be matched
maxTimeInMinutes
int
recipes should take this total time at maximum
minHealthScore
double
filter recipes with healthScore more than specified value
ordering
has_instructions
paging
labels
exclude_ingredients
include_ingredients
glycemic_filter
nutrition
fields
array
custom_labels
object
boolean
Flag to switch search results between search with embeddings and regular search
In addition to the base attributes, there are additional objects that contain more detailed information on the search parameters.
Paging
Labels
Exclude Ingredients
Include Ingredients
Glycemic Filter
Nutrition
Allow to use numeric values of
Energy -
NUTRITION_ENERGY
Fat -
NUTRITION_FAT
Proteine -
NUTRITION_PROTEINE
Carbohydrate -
NUTRITION_CARBOHYDRATE
Values can set by using gt
,lt
,gte
,lte
expressions, for example:
Ordering
Fields
Custom Labels
Recipes with Full license
Apply Implicit Preferences
Field manages search resultes. Two options available: Search results with user's embedding, for users who accepted this type of search in ST app; And regular search results.
Default value: true
Fallback if embedding is not available: regular search results
Sample Request
Use-case request examples
Boost recipes by certain device, technique, ingredient
Using recipe labels to search or boost recipes will now also take intents set for this recipe into account. I.e. if a recipe has intents for an oven and search is performed with "device": "DEVICE_OVEN"
, the recipe will be boosted.
Search recipe with certain device intents
Note: recipes AI identified to be suitable for cooking with a device will also be returned, currently there's no way to search recipes strictly with intents defined
You may find the complete list of devices supported in search on API definition page under the section request body
-> model
-> labels
-> device
or in whisk.api.shared.v1.Device
model
Note: the instructions.steps.intents
field is deprecated and will not be extended.
You will find intents in instructions.steps.instruction_intents.attributes
field. Each intent comes as an object with following fields
equipment_action
- describes what equipment and in what mode is going to be used (utensils like frying pan does not have modes or attributes at all)attributes
- the conditions to be used when cooking, the list may be empty which usually means until user stops the program on her own
The complete list of supported equipment, modes and attributes can be found inside whisk.api.recipe.v2.Intents
model
e.g.
Last updated