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.mealTime
-- to filter to search recipes by a determine meal time such asBREAKFAST
,LUNCH
,DINNER
,SNACK or TREAT_DESSERT
hasinstructions
-- to filter recipes that have instructions.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.
Available Fields
Field
Type
Required
Description
query
String
False
Query string
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
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.
ingredientLines
String
False
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
}
}
}
}
Filter by ingredient restriction
This example searches for a “salad” recipe where all results must include the ingredient “tomato” and exclude the ingredient “egg.”
query {
recipeSearch(
query:"salad"
filter:{
must:{
ingredients:"tomato"
}
mustNot:{
ingredients:"egg"
tags:"high-fat"
}
}
){
edges{
node{
name
ingredients{
name
}
ingredientLines
}
}
}
}
Last updated
Was this helpful?