# Recipe Search

Use the `recipeSearch` query to find recipes that match the search query and a set of optional filters.&#x20;

### Available filters

* [`macroNutrientsRange` ](#search-by-macro-nutrients-ranges)-- to filter that search for recipes with the same amount of calories.
* [`dietaryTag`](#search-by-dietarytag) -- to filter to search recipes by using a specific dietary tags.
* [`ingredients`](#search-by-ingredients) -- to filter to search recipes that contain one or more ingredients.
* [`cuisines`](#search-by-cuisine) -- to filter to search recipes by using a variety of [cuisine ](https://docs.suggestic.com/graphql/objects/recipe/recipe-object/cuisines#available-cuisines)names.&#x20;
* [`mealTime`](#search-with-multiple-filters-and-no-query-string) -- to filter to search recipes by a determine meal time such as `BREAKFAST`, `LUNCH`, `DINNER`, `SNACK or TREAT_DESSERT`
* [`hasinstructions`](#search-with-multiple-filters-and-no-query-string) -- to filter recipes that have instructions.
* [`filter`](https://docs.suggestic.com/graphql/objects/food-logs/food-filter)-- The filter object refines food results based on various criteria. It supports logical operators: **must (AND)** and **should (OR)**. Additionally, the **mustNot** operator is available to exclude foods that match specific ingredients or tags.

{% hint style="info" %}
This query doesn't automatically filter out recipes that "break" a user's restrictions or program, but you may use the recipe's [adherence ](https://docs.suggestic.com/graphql/objects/common/adherence)field to do that. Alternatively, please refer to [searchRecipeByNameOrIngredient.](https://docs.suggestic.com/graphql/query/search/recipe-search/recipe-by-name-or-ingredient)
{% endhint %}

{% hint style="warning" %}
Deprecated fields notice, the following fields are deprecated and no longer supported. They may be removed at any time without prior notice, so please avoid using them in new implementations and plan to migrate away from them as soon as possible.

Fields: `parsedIngredientLines`
{% endhint %}

### Available Fields

<table data-header-hidden><thead><tr><th>Field</th><th width="151">Type</th><th width="150">Required</th><th>Description</th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Type</strong></td><td><strong>Required</strong></td><td><strong>Description</strong></td></tr><tr><td><code>query</code></td><td>String</td><td>False</td><td>Query string</td></tr><tr><td><code>dietaryTag</code></td><td><a href="https://docs.suggestic.com/graphql/objects/recipe/recipe-object/tags">DietaryTag</a></td><td>False</td><td> Possible Values: <code>VEGETARIAN</code>, <code>VEGAN</code>, <code>PLANT_BASED</code>, <code>DAIRY_FREE</code>, <code>GLUTEN_FREE</code></td></tr><tr><td><code>first</code></td><td>Int</td><td>False</td><td>Quantity of results </td></tr><tr><td><code>maxPrepTime</code></td><td>Int</td><td>False</td><td><p>Maximum preparation time in minutes. </p><p>Filters out recipes with prep time longer than the value.</p></td></tr><tr><td><code>minPrepTime</code></td><td>Int</td><td>False</td><td><p>Minimum preparation time in minutes.</p><p>Filters out recipes with prep time lower than the value.</p></td></tr><tr><td><code>tags</code></td><td>[String]</td><td>False</td><td>List of tags</td></tr><tr><td><code>mealTime</code></td><td>RecipeMealTime</td><td>False</td><td>Meal of the day.  Possible Values:<code>BREAKFAST</code>, <code>LUNCH</code>, <code>DINNER</code>, <code>SNACK or TREAT_DESSERT</code></td></tr><tr><td><code>cuisines</code></td><td>[<a href="https://docs.suggestic.com/graphql/objects/recipe/recipe-object/cuisines">String</a>] </td><td>False</td><td>List of cuisines. Check <a href="https://docs.suggestic.com/graphql/objects/recipe/recipe-object/cuisines">this list</a> to see all the available cuisines.</td></tr><tr><td><code>numberOfIngredients</code></td><td>Int</td><td>False</td><td>Quantity of ingredients in the recipe</td></tr><tr><td><code>hasImage</code></td><td>Boolean</td><td>False</td><td>True if the recipe has an image</td></tr><tr><td><code>hasInstructions</code></td><td>Boolean</td><td>False</td><td>True if the recipe has instructions. Recipes "from the internet" do not have instructions.</td></tr><tr><td><code>Ingredients</code></td><td><a href="https://docs.suggestic.com/graphql/objects/food-logs/ingredients">Ingredients</a></td><td>False</td><td>List of ingredients</td></tr><tr><td><code>ingredientLines</code></td><td>String</td><td>False</td><td></td></tr><tr><td><code>macroNutrientsRange</code></td><td><a href="../../../objects/common/macronutrientsrangeinput">MacroNutrientsRangeInput</a></td><td>False</td><td>Macro and micronutrient ranges</td></tr><tr><td><code>sourceUrlWorks</code></td><td>Boolean</td><td>False</td><td><strong>True</strong> if the URL is working. Otherwise displays <strong>False</strong>. <br>There are meal plans already created show recipes with URLs not working or invalid. This will help users to check recipes before rendering them to an external site. </td></tr><tr><td><code>filter</code></td><td><a href="https://docs.suggestic.com/graphql/objects/food-logs/filter">Food Filter</a></td><td>false</td><td>Object that filters food according to different criteria. Use this object to filter more than one <strong>mealTime</strong> and multiple <strong>Ingredients</strong>.</td></tr><tr><td>servingQuantity</td><td>Int</td><td>false</td><td>Filter by the number of servings a recipe yields.</td></tr></tbody></table>

## Examples

### Search by dietaryTag

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(
    query: "pancakes"
    dietaryTag: GLUTEN_FREE
    first: 5
) {
    edges {
      node {
        name 
        id
        author
        tags
        isPurchasable
        sourceUrlWorks
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "name": "Pancakes",
            "id": "UmVjaXBlOjlhN2NjYTU3LWE5NDEtNDAwYS1iY2JjLTM5MGY5NmU3Y2QzYg==",
            "author": "Dr. Joel Kahn",
            "tags": [
              "VEGETARIAN",
              "GLUTEN_FREE",
              "Breakfast"
            ],
            "isPurchasable": false,
            "sourceUrlWorks": false
          }
        },
        {
          "node": {
            "name": "Pancakes",
            "id": "UmVjaXBlOjUwZDNlMDE2LWYyNmYtNDczOS1hODIxLTg5NTEzZGJjMjZjZQ==",
            "author": "Hadia's Lebanese Cuisine",
            "tags": [
              "VEGETARIAN",
              "GLUTEN_FREE",
              "Breakfast"
            ],
            "isPurchasable": false,
            "sourceUrlWorks": true
          }
        },
        {
          "node": {
            "name": "Pancakes",
            "id": "UmVjaXBlOjEwMjBmNGI5LTRmZGQtNGY4YS1iYjc1LTIyNDhhNzgzYWFkNA==",
            "author": "Food.com",
            "tags": [
              "VEGETARIAN",
              "GLUTEN_FREE",
              "Breakfast"
            ],
            "isPurchasable": false,
            "sourceUrlWorks": true
          }
        },
        {
          "node": {
            "name": "Golden Pancakes",
            "id": "UmVjaXBlOjM3OTNlZTdjLTcyOTMtNDA3Mi05Zjk0LTBmNmFmZWQyYjBlMA==",
            "author": "Food52",
            "tags": [
              "VEGETARIAN",
              "GLUTEN_FREE",
              "Breakfast"
            ],
            "isPurchasable": false,
            "sourceUrlWorks": true
          }
        },
        {
          "node": {
            "name": "Quinoa Pancakes",
            "id": "UmVjaXBlOjNiOWM1YjFkLWYzYTItNDYwMy04OWYzLWI5Yjc3OGJmNjgzMA==",
            "author": "Lively Table",
            "tags": [
              "VEGETARIAN",
              "DAIRY_FREE",
              "GLUTEN_FREE",
              "Breakfast"
            ],
            "isPurchasable": false,
            "sourceUrlWorks": true
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search by Macro Nutrients Ranges

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(
    query: "salad",
    macroNutrientsRange: {
    	calories: {gte:100, lte:300},
    	proteinCalories: {gte:100, lte:200},
  		fatCalories: {gte:50, lte:200},
  		carbsCalories: {gte:30, lte:150},
      protein: {gte:20, lte:200}
    }
    first:3) {
    edges {
      node {
        id
        name
        nutrientsPerServing {
          calories
          protein
          fat
          carbs
          omega3
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOjNhOGQ5NTcwLTAxYzgtNDFhZS04YTMyLTIxZTYxYmIwMGRiMQ==",
            "name": "Turkey Taco Salad",
            "nutrientsPerServing": {
              "calories": 264.17,
              "protein": 26.86,
              "fat": 5.81,
              "carbs": 26.12,
              "omega3": 0.03
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjM4YWY2YWY0LWQ5NTItNDhlYy1hNDQyLTRhODczNmYwYzc0Ng==",
            "name": "Chili Chicken Salad",
            "nutrientsPerServing": {
              "calories": 228.56,
              "protein": 26.34,
              "fat": 5.74,
              "carbs": 17.88,
              "omega3": 0.02
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjA0MDU5Y2YyLTk1OTYtNDBhMy1hOWFkLWI3MzBlMzJlYjExYQ==",
            "name": "Blackened Shrimp Salad",
            "nutrientsPerServing": {
              "calories": 242.14,
              "protein": 32.15,
              "fat": 6.58,
              "carbs": 13.59,
              "omega3": 1.15
            }
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search by Ingredients

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(query: "milk", ingredients: ["banana"]) {
    edges {
      node {
        name
        ingredients {
          name
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "name": "Monkey Milk",
            "ingredients": [
              {
                "name": "ripe banana"
              },
              {
                "name": "bananas"
              },
              {
                "name": "vanilla yogurt"
              },
              {
                "name": "milk"
              },
              {
                "name": "honey"
              },
              {
                "name": "ice cubes"
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search by Cuisine

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(query: "Taco" cuisines: "Mexican") {
    edges {
      node {
        name
        cuisines
      }
    }
  }
}
```

{% endtab %}

{% tab title="Results" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "name": "Taco Stuffed Avocados Aka “Avo-Tacos”",
            "cuisines": [
              "Mexican"
            ]
          }
        },
        {
          "node": {
            "name": "Taco Stuffed Avocados Aka “Avo-Tacos”",
            "cuisines": [
              "Mexican"
            ]
          }
        },
        {
          "node": {
            "name": "Taco Salad",
            "cuisines": [
              "Mexican"
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search with multiple filters and no query string

{% tabs %}
{% tab title="Query" %}

```graphql
 {
  recipeSearch(
    dietaryTag: GLUTEN_FREE
    mealTime: LUNCH
    hasInstructions: true
    macroNutrientsRange: {
      calories: { gte: 100, lte: 500 }
      proteinCalories: { gte: 100, lte: 500 }
      fatCalories: { gte: 50, lte: 500 }
      carbsCalories: { gte: 30, lte: 500 }
      protein: { gte: 20, lte: 200 }
    }
    first: 5
  ) {
    edges {
      node {
        id
        name
        author
        tags
        cuisines
        nutrientsPerServing {
          calories
          protein
          fat
          carbs
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Results" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOmFiMmIzNTFmLTZmNWItNDEwOS1iODA3LTM1OGZhOTVkYjgyNQ==",
            "name": "Veggie Lasagna",
            "author": "Dr. Joel Kahn",
            "tags": [
              "VEGETARIAN",
              "GLUTEN_FREE",
              "Dinner",
              "PLANT_BASED",
              "DAIRY_FREE",
              "VEGAN"
            ],
            "cuisines": [],
            "nutrientsPerServing": {
              "calories": 455.24,
              "protein": 35.86,
              "fat": 8.59,
              "carbs": 58.62
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmZmOTllZjY5LTY4MjEtNDU5Ny1iOGI1LWUxOTk3ODMzN2QxNA==",
            "name": "Smoked Mackerel Salad With Fennel And Apple",
            "author": "Suggestic",
            "tags": [
              "Salad",
              "GLUTEN_FREE",
              "DAIRY_FREE"
            ],
            "cuisines": [],
            "nutrientsPerServing": {
              "calories": 468.78,
              "protein": 37.02,
              "fat": 10.13,
              "carbs": 57.37
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmVmNzBhNTY2LWY5NzctNGI2MS1iMzdiLTBjMzQ2NWZmYTFjOA==",
            "name": "Shallot Lime Marinated Flank Steak",
            "author": "J.J. Virgin",
            "tags": [
              "Dinner",
              "GLUTEN_FREE",
              "DAIRY_FREE"
            ],
            "cuisines": [],
            "nutrientsPerServing": {
              "calories": 323.06,
              "protein": 32.04,
              "fat": 17.4,
              "carbs": 9.58
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmFjOGFkOGE5LTk4NTYtNGU2MS1hZTNkLTMyNmE0ZTMxNDZmZQ==",
            "name": "Taj’S Chicken Tenders",
            "author": "J.J. Virgin",
            "tags": [
              "Appetizer",
              "GLUTEN_FREE",
              "DAIRY_FREE"
            ],
            "cuisines": [],
            "nutrientsPerServing": {
              "calories": 309.92,
              "protein": 30.22,
              "fat": 7.52,
              "carbs": 30.33
            }
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmQ0ZTQ0NTNhLTQyODgtNDE5OS1hZjMwLTNlY2RkYTkyYWVhZg==",
            "name": "Tuna-Stuffed Tomato",
            "author": "Suggestic",
            "tags": [
              "Salad",
              "GLUTEN_FREE",
              "DAIRY_FREE"
            ],
            "cuisines": [],
            "nutrientsPerServing": {
              "calories": 484.66,
              "protein": 27.3,
              "fat": 32.99,
              "carbs": 19.64
            }
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search for more than one mealtime at the same time

The following example searches for Breakfast, Lunch, ***and*** Dinner recipes.

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(
    filter: {
      must: [{ mealTime: BREAKFAST }, { mealTime: LUNCH }, { mealTime: DINNER }]
    }
  ) {
    edges {
      node {
        id
        name
        ingredients {
          name
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOjI2NDAwYzExLTEyNWQtNDc4Mi1iODNjLTZjNzQ5MjNhZTlhYg==",
            "name": "Turkey And Veggie Wrap",
            "ingredients": [
              {
                "name": "Yellow bell pepper"
              },
              {
                "name": "Baby spinach"
              },
              {
                "name": "Olive oil"
              },
              {
                "name": "Turkey breast"
              },
              {
                "name": "Brown rice tortilla"
              },
              {
                "name": "Rosemary"
              },
              {
                "name": "Onion"
              },
              {
                "name": "Lemon juice"
              }
            ]
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjYwYWM3NzA1LTBmNGEtNDVlMS04MGEwLWZlMTlmM2ExMWMzOA==",
            "name": "Spicy Black Bean And Quinoa Burritos",
            "ingredients": [
              {
                "name": "Cilantro"
              },
              {
                "name": "Corn"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Orange bell pepper"
              },
              {
                "name": "Chili powder"
              },
              {
                "name": "Garlic"
              },
              {
                "name": "Water"
              },
              {
                "name": "Black beans"
              },
              {
                "name": "Roma tomatoes"
              },
              {
                "name": "Tortillas"
              },
              {
                "name": "Red onion"
              },
              {
                "name": "Cumin"
              },
              {
                "name": "Chipotle powder"
              },
              {
                "name": "Quinoa"
              }
            ]
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmE0NDY2NmViLWY1YjEtNDhiNS1hNDJhLWZmYTBlMjk4MTA1Yg==",
            "name": "Mint Frittata",
            "ingredients": [
              {
                "name": "Eggs"
              },
              {
                "name": "Parmesan cheese"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Black pepper"
              },
              {
                "name": "Olive oil"
              },
              {
                "name": "Onion"
              },
              {
                "name": "Mint leaves"
              }
            ]
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmZiYTZkYTBiLWRkYTEtNGUyYS1hODQ2LWZmNWEwYTUzYzMzOA==",
            "name": "Guacamole-Manchego Quesadillas With Salad",
            "ingredients": [
              {
                "name": "Flour tortillas"
              },
              {
                "name": "Vinaigrette dressing"
              },
              {
                "name": "Guacamole"
              },
              {
                "name": "Salad"
              },
              {
                "name": "Manchego cheese"
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

The following is a recursive example in which the recipes are searched by ***fish*** or ***spicy*** recipes ***and breakfast*** as a mealtime.

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(
    filter: {
      should: [
        { name: "fish" }
        { must: [{ name: "spicy" }, { mealTime: BREAKFAST }] }
      ]
    }
  ) {
    edges {
      node {
        id
        name
      }
    }
  }
}


```

{% endtab %}

{% tab title="Result" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOmJlZWNhMjEwLTFlOWQtNDgyNy1hZDZjLTljMmUyOTI1ZDgwYg==",
            "name": "Easy Pita Lunch Ideas"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjhiNmNkYmNkLTk3MzAtNDQ2Ni1iNGJiLWNlNzZhMTMxZGFmYQ==",
            "name": "Chile-Cumin Lamb Meatballs With Yogurt And Cucumber"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmQyNGVmNjBjLWU5ZjktNDM1Ny1hZjU5LWZmZWZhMGVjMzFkZA==",
            "name": "Vegan Stacked Enchilada Pie"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjFhMDgzZWVmLWNjZTctNDNlOC05MjgzLTFkYzQwY2QzYWU5Yw==",
            "name": "Mung Bean + Cilantro Falafel Tacos (V + Gf)"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjhkNWEwYTgwLTdiZGMtNDY5ZC1iYWMxLTJlNTBlOTA2YTBlOA==",
            "name": "French Tuna Burger With Green Bean Salad"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjA3Zjg4OWMyLWI4Y2YtNDE2ZC04MDM1LTA1MDhkMTkyMjFhMg==",
            "name": "Farmers Market Minestrone Soup {Share The Love}"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjFjYjlhNTU0LTRjMGYtNDNiNi1hYWViLWYwNzcxNGJmNWU4Mg==",
            "name": "Vegan Cauliflower, Potato, And Chickpea Curry"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmY4OTZiNTY5LWFlNmEtNGFhMy04NDgzLTZlMDVjODM4YTc4NQ==",
            "name": "Yogurt-Marinated Chicken Shawarma"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmZmMTg3YmYwLTIxMmItNDUzZS04MTkyLWI2YTFlYThiNzE0OA==",
            "name": "Pan Bagnat - A Nicoise-Style Sandwich"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmNmODY2ZWI2LTJmYjktNDUxNS1hOTBhLWYxN2Q5OTNlNzBjNQ==",
            "name": "Mediterranean Chopped Salad"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjYwYTU0MzNiLTVjN2MtNDBmOS05NjgwLTk1ZTUyNGQzN2ZlYg==",
            "name": "Thai Panang Curry"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjRkMThiMTBjLTUyZGItNDg2YS05MDc2LTFjZjM3NzZhZDI0OQ==",
            "name": "Peanut Thai Vegetable Stew"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjBkZjIyNjQxLWQ4ZTktNDQxMS1hNGJhLTFiN2UzZWYyMGNjZg==",
            "name": "Slow-Cooker Cuban Brisket Taco Bowls"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjFmOWVmZWY1LTZjYzEtNGE1Ny1hOWZmLWZjMjEzZjAxNTgxOQ==",
            "name": "Easy Peanut Pork With Crunchy Veg"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjk1YmI2YzQwLTQzOGUtNDUwOS04OTc4LTk5OGRmY2ZlNzFhNQ==",
            "name": "Red Lentil Sweet Potato Hemp Burgers With Ginger Basil Sauce"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjRkMGI2YjFhLTk4NGItNGRkZS05NTc3LThmMGM3N2QyMzdjNQ==",
            "name": "Leftover Salade Nicoise"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmY2MmUxNDlhLWFkMmMtNGZhNC1iZDM4LTczYTc4ZTVlMjc1ZQ==",
            "name": "Spicy Peanut Noodles With Edamame & Shrimp"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjI1YzZhOGU4LTk1YjAtNGI1NS1hNjhjLWVmODA1MWU4ZjczZA==",
            "name": "Southwest Pinto Bean Burgers With Chipotle Mayonnaise"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjQ2MzVmNmJlLTgwODEtNDczOS05ZmJjLWQxZjQ0MGQyNDgxZQ==",
            "name": "Apple-Brat Burgers"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmIzM2IwYjM4LWMyZmUtNGUzZS1iY2UyLTg1OTU5NjMwMzZmYQ==",
            "name": "Sri Lankan Black Chicken Curry With Roasted Spices"
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Search for multiple ingredients and two mealtimes&#x20;

The following example searches *breakfast* **AND** *snack* **AND** which contains *milk* and *bread* as a single ingredient **OR** yogurt

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipeSearch(
    filter: {
      must: [{ mealTime: BREAKFAST }, { mealTime: SNACK }]
      should: [{ ingredients: "milk, bread" }, { ingredients: "yogurt" }]
    }
  ) {
    edges {
      node {
        id
        name
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "id": "UmVjaXBlOjEzNGE1MGYzLWJjMGEtNGVmNS1hNjlkLWQ4MTNiNzFlZWEyMA==",
            "name": "Protein Power Lentils And Amaranth Patties"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjQ3NzlmYmJmLTM1MjktNDhiMi1iOGU4LTgyMWNiNjQ2MmQwYw==",
            "name": "Banana And Mixed Berry Smoothie "
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmViOTcyZWI0LTA3OGMtNDFlNC1iMDlkLWU1YTljMTA3MzZmOQ==",
            "name": "Back To School Granola Bars"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjZjYWNlNTJlLTEzMWEtNDM0MS05Zjk5LWI2MDUzZTY3ZTNjOA==",
            "name": "Sugar-Free Healthy Granola Bars"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmM0YmQzMDIzLWZmNWMtNGYwOC05MTdkLTJhYjcyYTNlNjU4Yw==",
            "name": "Apple & Banana Quinoa Oat Bites"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmNiZDFjOTZkLTYyNWMtNDExNi1iNzhkLTFkMjhiMjdmMGVjOQ==",
            "name": "Vegan Coconut Milk Raspberry Smoothie"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmM2NjkyNjUyLWMwOGQtNDMxOC04ZmQzLWVkMTc5YjYzYTQzMQ==",
            "name": "Green Smoothie"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjVjZDkwMDkzLTYyZDItNGUyOS1iNjZkLWU3OTk1MjRiZjRlMQ==",
            "name": "No Sugar Added Granola Bars"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjQ4MWM2MDFkLWNmYjMtNDgyYy04YzhjLTEwMzhlZmRjZDYyMQ==",
            "name": "Coconut Yogurt With Blackberries And Almonds"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmMzZGE3OWY2LTJhZTctNGRjNS05MDJkLWJjMDMwMDRlZjQyMg==",
            "name": "Apple Cinnamon Granola Bites"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjgzZDc0NzYwLTM0MzctNDZhNy1iNjdlLTM1ZTZiZjBiZmNmZA==",
            "name": "Greek Yogurt With Nuts And Berries"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmQ3MTMxOGZjLTRjMjQtNGExMS05YTFkLTRjYTgwYjViMTRiMw==",
            "name": "Coconut Yogurt With Blackberries And Almonds"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjE0MDEzNDJjLTkyMDctNDFjNC1hM2JlLWY5NDIyYWIxNDczYg==",
            "name": "Peanut And Sesame Brittles Or Mungfali And Til Ke Chikki"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmJkOTFlMjVjLTIyNzEtNDQzMS05ZWUxLTg2ZDg2ODNjYzY0ZQ==",
            "name": "Scrambled Egg Toasts With Avocado"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjYyNDZmNjVmLTc4NTMtNDQyMy04ODI5LWYxZjI1YWVkYmUyYQ==",
            "name": "Delicious Poached Eggs, Spinach And Avocado Toast"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmZkNDU3MzFkLWRjOGQtNDkzMS1iNGQ5LTA1ZWExZmIyNjhlMw==",
            "name": "Cinnamon 'N' Spice Pecans"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmNjNTEzZTczLTE0MTktNGYwZC1iMWY4LWM5MzVhZDA3YjU2ZA==",
            "name": "Sina'S Georgia-Style Boiled Peanuts"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOjE1YTA2MWQzLTc2MTMtNGZkNC05YjA0LWYyMzRiMTNlYTUwOA==",
            "name": "Oat-Date Bars"
          }
        },
        {
          "node": {
            "id": "UmVjaXBlOmY0YmFmNTU2LWQyY2UtNDA1Ni1hNzdjLWEwMGEyMjFlM2VhNg==",
            "name": "Soft Boiled Eggs With Grilled Cheese Soldiers"
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Filter by number of servings

```graphql
{
  recipeSearch(servingQuantity: 6) {
    edges {
      node {
        name
        numberOfServings
      }
    }
  }
}
```

### Filter by ingredient restriction

This example searches for a “salad” recipe where all results must include the ingredient “tomato” and exclude the ingredient “egg.”

{% tabs %}
{% tab title="Query" %}

```graphql
query {
  recipeSearch(
    query:"salad" 
    filter:{
      must:{
        ingredients:"tomato"
      }
    	mustNot:{
        ingredients:"egg"
        tags:"high-fat"
      }
    }
  ){
    edges{
      node{
        name
        ingredients{
          name
        }
        ingredientLines
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "recipeSearch": {
      "edges": [
        {
          "node": {
            "name": "Rocket Salad",
            "ingredients": [
              {
                "name": "Rocket leaves"
              },
              {
                "name": "Tomato"
              },
              {
                "name": "Corn"
              },
              {
                "name": "Cucumber"
              },
              {
                "name": "Tomatoes"
              },
              {
                "name": "Olive oil"
              },
              {
                "name": "Balsamic vinegar"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Peppercorns"
              }
            ],
            "ingredientLines": [
              "2 cup rocket leaves",
              "1 tomato, diced",
              "1/4 cup corn",
              "1 cucumber, dced",
              "2 tbsp diced sun dried tomatoes",
              "1 tbsp olive oil",
              "1 tbsp balsamic vinegar",
              "Salt, to taste",
              "Pepper, to taste"
            ]
          }
        },
        {
          "node": {
            "name": "Shopska Salad",
            "ingredients": [
              {
                "name": "Tomato"
              },
              {
                "name": "Cucumber"
              },
              {
                "name": "Red bell pepper"
              },
              {
                "name": "Olives"
              },
              {
                "name": "Olive oil"
              },
              {
                "name": "Balsamic vinegar"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Black pepper"
              },
              {
                "name": "Feta cheese"
              },
              {
                "name": "Parsley"
              },
              {
                "name": "Whole grain bread"
              }
            ],
            "ingredientLines": [
              "1 large tomato, diced",
              "1 cucumber, diced",
              "1 red bell pepper, diced",
              "1 handful pitted olives (optional)",
              "Extra virgin olive oil, to taste",
              "1 oz balsamic vinegar",
              "Salt, to taste",
              "Freshly cracked black pepper, to taste",
              "4 oz feta cheese",
              "1 oz flat leaf parsley, chopped",
              "2 oz whole-grain bread"
            ]
          }
        },
        {
          "node": {
            "name": "Caprese Salad",
            "ingredients": [
              {
                "name": "Tomato"
              },
              {
                "name": "Mozzarella cheese"
              },
              {
                "name": "Basil leaves"
              },
              {
                "name": "Olive oil"
              },
              {
                "name": "Balsamic vinegar"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Black pepper"
              }
            ],
            "ingredientLines": [
              "1 tomato, sliced",
              "4 oz mozzarella cheese",
              "1/4 cup basil leaves",
              "1 tbsp olive oil",
              "1 tsp balsamic vinegar",
              "Salt, to taste",
              "Ground black pepper, to taste"
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}
