Search a Recipe

A method to search recipes.

Recipe search can be performed through generic API search endpoint by passing type=recipe. You can see an example of using this API at Getting Started and at the Showcase.

https://api.whisk.com/recipe/v2/search
Request
Response
Request
Body Parameters
Search Request
optional
object
Response
200: OK
This will return a collection of recipes objects (see Recipe Data section for more information).
{
"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://whisk-res.cloudinary.com/image/upload/v1523894700/custom_upload/ba4d7363cd46c736675d2cc08754f5bc.png",
"responsive": {
"url": "https://whisk-res.cloudinary.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:

{
"query": "string",
"language": "string",
"country": "string",
"min_ingredients_should_match": 0,
"max_time_in_minutes": 0,
"min_health_score": 0,
"ordering": "ORDERING_INVALID",
"has_instructions": true,
"paging": {
...
},
"labels": [
...
],
"exclude_ingredients": {
...
},
"include_ingredients": {
...
},
"glycemic_filter": {
...
},
"nutrition": [
...
],
"fields": [
...
],
"custom_labels": {
...
}
}

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

object

labels

array

exclude_ingredients

object

include_ingredients

object

glycemic_filter

object

nutrition

array

fields

array

custom_labels

object

In addition to the base attributes, there are additional objects that contain more detailed information on the search parameters.

Paging

"paging": {
"limit": 0,
"cursors": {
"after": "string",
"before": "string"
}
},

Labels

"labels": [
{
"label": {
"diet": "DIET_INVALID",
"category": "CATEGORY_INVALID",
"avoidance": "AVOIDANCE_INVALID",
"cuisine": "CUISINE_INVALID",
"meal_type": "MEAL_TYPE_INVALID",
"nutrition": "NUTRITION_INVALID",
"feature": "string",
"holiday": "HOLIDAY_INVALID",
"seasonality": "SEASONALITY_INVALID"
},
"boost": true
}
],

Exclude Ingredients

"exclude_ingredients": {
"list": [
"string"
]
},

Include Ingredients

"include_ingredients": {
"list": [
"string"
]
},

Glycemic Filter

"glycemic_filter": {
"glycemic_index": 0,
"glycemic_load_total": 0,
"glycemic_load_serving": 0
},

Nutrition

"nutrition": [
{
"nutrition": "NUTRITION_INVALID",
"condition": "CONDITION_INVALID",
"value": 0
}
],

Ordering

"ordering": "ORDERING_INVALID",

Fields

"fields": [
"RECIPE_FIELD_INVALID"
],

Custom Labels

"custom_labels": {
"everywhere": {
"in": [
{
"group": "string",
"label": "string"
}
],
"boost_in": [
{
"group": "string",
"label": "string"
}
]
},
"in_recipe": {
"in": [
{
"group": "string",
"label": "string"
}
],
"boost_in": [
{
"group": "string",
"label": "string"
}
]
},
"in_ingredients": {
"in": [
{
"group": "string",
"label": "string"
}
],
"boost_in": [
{
"group": "string",
"label": "string"
}
]
},
"in_instruction_steps": {
"in": [
{
"group": "string",
"label": "string"
}
],
"boost_in": [
{
"group": "string",
"label": "string"
}
]
}
}

Sample Request

curl -X POST "https://api.whisk.com/recipe/v2/search" \
-H "accept: application/json" \
-H "Authorization: Token <Access-Token>" \
-H "Content-Type: application/json" \
-d "{ \"language\": \"en\", \"paging\" : {\"limit\": 2}}"