# Recipe Search by Ingredients

Use `searchRecipesByIngredients`to find recipes that contain a list of ingredients.

### **Parameter**

| Argument          | Type       | Description                             |
| ----------------- | ---------- | --------------------------------------- |
| `mustIngredients` | \[String]! | List of ingredients recipe must contain |

## Example

### Get the list of recipes with specific ingredients

Get the list of recipes which includes broccoli, eggs, and avocado ingredients

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

```graphql
{
  searchRecipesByIngredients(
    mustIngredients: ["broccoli", "eggs", "avocado"]
  ) {
    edges {
      node {
        name
        ingredients {
          name
        }
       ingredientLines
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "searchRecipesByIngredients": {
      "edges": [
        {
          "node": {
            "name": "Garlic Roasted Broccoli",
            "ingredients": [
              {
                "name": "Olive oil"
              },
              {
                "name": "Broccoli florets"
              },
              {
                "name": "Garlic"
              },
              {
                "name": "Salt"
              }
            ],
            "ingredientLines": [
              "12 oz broccoli leaves",
              "1 tbsp extra virgin olive oil",
              "2 cloves garlic, sliced",
              "Salt, to taste",
              "Freshly ground black pepper to taste"
            ]
        },
        {
          "node": {
            "name": "Avocado With Tomatoes",
            "ingredients": [
              {
                "name": "Avocado"
              },
              {
                "name": "Tomato"
              },
              {
                "name": "Cumin"
              },
              {
                "name": "Garlic powder"
              },
              {
                "name": "Oregano"
              },
              {
                "name": "Salt"
              },
              {
                "name": "Lemon juice"
              }
            ],
            "ingredientLines": [
              "* 1 avocado",
              "* 1/2 tomato",
              "* a dash of cumin powder",
              "* a dash of garlic powder",
              "* a dash of oregano",
              "* little salt to taste",
              "* few drop of lemon juice (optional)"
             ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

**Note:** If no ingredients are added into the `mustIngredients` string, recipes with all ingredients will be retrieved.

### UI/UX example

In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.&#x20;

Login to the App, go to the **Recipes** option, introduce **broccoli, eggs, avocado** on the search field, all the recipes related to those ingredients are displayed. Look at the first two recipes, those are the same as the ones returned with the API query. Select the **Garlic Roasted Broccoli**, the ingredients are the same as the result retrieved in the API query

![](/files/dd9C3bf743ElKrbJFnl6)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/search/recipe-search/recipes-by-ingredients.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
