Recipe Search

Search for recipes using a variety of filters

Use the recipeSearch query to find recipes that match the search query and a set of optional filters.

Available filters

  • macroNutrientsRange -- to filter that search for recipes with the same amount of calories.

  • dietaryTag -- to filter to search recipes by using a specific dietary tags.

  • ingredients -- to filter to search recipes that contain one or more ingredients.

  • cuisines -- to filter to search recipes by using a variety of cuisine names.

  • mealTime -- to filter to search recipes by a determine meal time such as BREAKFAST, LUNCH, DINNER, SNACK or TREAT_DESSERT

  • hasinstructions -- to filter recipes that have instructions.

This query doesn't automatically filter out recipes that "break" a user's restrictions or program, but you may use the recipe's adherence field to do that. Alternatively, please refer to searchRecipeByNameOrIngredient.

Available Fields

Field

Type

Required

Description

query

String

False

Query string

dietaryTag

False

Possible Values: VEGETARIAN, VEGAN, PLANT_BASED, DAIRY_FREE, GLUTEN_FREE

first

Int

False

Quantity of results

maxPrepTime

Int

False

Maximum preparation time in minutes.

Filters out recipes with prep time longer than the value.

minPrepTime

Int

False

Minimum preparation time in minutes.

Filters out recipes with prep time lower than the value.

tags

[String]

False

List of tags

mealTime

RecipeMealTime

False

Meal of the day. Possible Values:BREAKFAST, LUNCH, DINNER, SNACK or TREAT_DESSERT

cuisines

False

List of cuisines. Check this list to see all the available cuisines.

numberOfIngredients

Int

False

Quantity of ingredients in the recipe

hasImage

Boolean

False

True if the recipe has an image

hasInstructions

Boolean

False

True if the recipe has instructions. Recipes "from the internet" do not have instructions.

Ingredients

False

List of ingredients

ingredientLines

String

False

macroNutrientsRange

False

Macro and micronutrient ranges

sourceUrlWorks

Boolean

False

True if the URL is working. Otherwise displays False. 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.

filter

false

Object that filters food according to different criteria. Use this object to filter more than one mealTime and multiple Ingredients.

servingQuantity

Int

false

Filter by the number of servings a recipe yields.

Examples

Search by dietaryTag

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

Search by Macro Nutrients Ranges

{
  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
        }
      }
    }
  }
}

Search by Ingredients

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

Search by Cuisine

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

Search with multiple filters and no query string

 {
  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
        }
      }
    }
  }
}

Search for more than one mealtime at the same time

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

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

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

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

Search for multiple ingredients and two mealtimes

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

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

Filter by number of servings

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

Last updated