Search a Recipe
A method to search recipes.
Recipe Search
POST https://api.whisk.com/recipe/v2/search
Request Body
Search Request
object
{
"data": [
{
"content": {
"id": "97f77cceca5d11e7ae7e42010a9a0035",
"name": "Quick coronation chicken sandwich",
"description": "Use leftover roast chicken to make a delicious coronation chicken sandwich ready to pack in your lunchbox.",
"images": [
{
"url": "http://cdnwp.audiencemedia.com/wp-content/uploads/2015/01/478091-1-eng-GB_coronation-chick-sandwich-470x540.jpg",
"responsive": {
"url": "https://lh3.googleusercontent.com/crjY_vyxK8kdBYYBd6VVtlGwIXuG3pn9DuCSWP4-_VtURbrYfpKPrYDMmrlCwc8kqSAsgCBtjhqU2C7PEjU0wMDh4FSK",
"width": 470,
"height": 540
}
},
...
],
"source": {
"name": "deliciousmagazine.co.uk",
"displayName": "delicious. magazine",
"sourceRecipeUrl": "http://www.deliciousmagazine.co.uk/recipes/quick-coronation-chicken-sandwich/",
"license": "Fairuse",
"image": {
"url": "https://res.cloudinary.com/whisk/image/upload/v1401879186/content/publisher_logos/delicious-magazine-logo.png",
"responsive": {
"url": "https://res.cloudinary.com/whisk/image/upload/v1401879186/content/publisher_logos/delicious-magazine-logo.png",
"width": 200,
"height": 200
}
}
},
"author": {
"name": "Author name",
"image": {
"url": "https://image-cdn.whisk.com/image/upload/v1523894700/custom_upload/ba4d7363cd46c736675d2cc08754f5bc.png",
"responsive": {
"url": "https://image-cdn.whisk.com/image/upload/v1523894700/custom_upload/ba4d7363cd46c736675d2cc08754f5bc.png",
"width": 800,
"height": 800
}
}
},
"numberOfServings": 1,
"labels": {
"mealType": [],
"cuisine": [],
"category": [
{
"name": "quick-and-easy",
"displayName": "Quick and easy"
}
]
}
},
"matchedIngredients": [
{
"name": "meat"
},
{
"name": "bread"
}
]
},
{
"content": {
...
}
}
],
"paging": {
"cursors": {
"after": "eyJpZCI6ImNhZjVlOWY3Y2YxNzFkYjBmZTdkYjJmOTM4M2M0ZDIzIiwiaW5kZXgiOjF9"
},
"total": 1300
}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
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_ENERGYFat -
NUTRITION_FATProteine -
NUTRITION_PROTEINECarbohydrate -
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
Was this helpful?