Search Recipes API

Search and filter thousands of recipes with natural language, e.g. pasta recipes without mushrooms but with truffles. You can filter by ingredients, diet, cuisine, meal type, macro and micro nutrition, intolerances, and much more.

This API wraps the search recipes endpoint by Recipe API. Check out the tutorial about writing a diet and nutrition app or how to write a meal planning app using this API.

Recipe Sorting Options

This is a list of possible values for the sort parameter.

  • (empty)
  • meta-score
  • popularity
  • healthiness
  • price
  • time
  • random
  • max-used-ingredients
  • min-missing-ingredients
  • alcohol
  • caffeine
  • copper
  • energy
  • calories
  • calcium
  • carbohydrates
  • carbs
  • choline
  • cholesterol
  • total-fat
  • fluoride
  • trans-fat
  • saturated-fat
  • mono-unsaturated-fat
  • poly-unsaturated-fat
  • fiber
  • folate
  • folic-acid
  • iodine
  • iron
  • magnesium
  • manganese
  • vitamin-b3
  • niacin
  • vitamin-b5
  • pantothenic-acid
  • phosphorus
  • potassium
  • protein
  • vitamin-b2
  • riboflavin
  • selenium
  • sodium
  • vitamin-b1
  • thiamin
  • vitamin-a
  • vitamin-b6
  • vitamin-b12
  • vitamin-c
  • vitamin-d
  • vitamin-e
  • vitamin-k
  • sugar
  • zinc
  • (empty)
  • meta-score
  • popularity
  • healthiness
  • price
  • time
  • random
  • max-used-ingredients
  • min-missing-ingredients
  • alcohol
  • caffeine
  • copper
  • energy
  • calories
  • calcium
  • carbohydrates
  • carbs
  • choline
  • cholesterol
  • total-fat
  • fluoride
  • trans-fat
  • saturated-fat
  • mono-unsaturated-fat
  • poly-unsaturated-fat
  • fiber
  • folate
  • folic-acid
  • iodine
  • iron
  • magnesium
  • manganese
  • vitamin-b3
  • niacin
  • vitamin-b5
  • pantothenic-acid
  • phosphorus
  • potassium
  • protein
  • vitamin-b2
  • riboflavin
  • selenium
  • sodium
  • vitamin-b1
  • thiamin
  • vitamin-a
  • vitamin-b6
  • vitamin-b12
  • vitamin-c
  • vitamin-d
  • vitamin-e
  • vitamin-k
  • sugar
  • zinc

Health Score ('healthiness')

Score % (between 0 and 100) = Average coverage of "good" nutrients - Average coverage of "bad" nutrients.

That is, the more of your daily requirements of vitamins and minerals are covered and lower amounts of things you should limit (sugar, salt etc.) the higher the score.

GET
https://api.apileague.com/search-recipes

Parameters

NameExampleDescription
query
s o q
pasta with mushrooms but without nutsThe search query.
cuisines
s o q
mexicanThe cuisine(s) of the recipes. One or more, comma-separated (will be interpreted as 'OR').
exclude-cuisines
s o q
indian,japaneseThe cuisine(s) the recipes must not match. One or more, comma-separated (will be interpreted as 'AND').
meal-type
s o q
dessertThe type of the recipe, one of: main course,side dish,dessert,appetizer,salad,bread,breakfast,soup,beverage,sauce,drink.
diet
s o q
paleoThe diet the recipes must adhere to. One of the following: paleo,primal,grain-free,pescetarian,lacto vegetarian,ovo vegetarian,vegan,vegetarian.
intolerances
s o q
gluten,dairy,shellfishA comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered.
equipment
s o q
blender,frying pan,bowlThe equipment required. Multiple values will be interpreted as 'OR'.
include-ingredients
s o q
tomato,cheeseA comma-separated list of ingredients that should/must be used in the recipes.
exclude-ingredients
s o q
olives,capersA comma-separated list of ingredients or ingredient types that the recipes must not contain.
fill-ingredients
b o q
trueAdd information about the ingredients and whether they are used or missing in relation to the query.
add-recipe-information
b o q
trueIf set to true, you get more information about the recipes returned.
max-time
n o q
45The maximum time in minutes it should take to prepare and cook the recipe.
min-servings
n o q
1The minimum amount of servings the recipe is for.
max-servings
n o q
8The maximum amount of servings the recipe is for.
min-calories
n o q
100The minimum amount of calories the recipe must have per serving.
max-calories
n o q
655The maximum amount of calories the recipe can have per serving.
min-carbs
n o q
10.1The minimum amount of carbohydrates in grams the recipe must have per serving.
max-carbs
n o q
25.5The maximum amount of carbohydrates in grams the recipe can have per serving.
min-protein
n o q
10.1The minimum amount of protein in grams the recipe must have per serving.
max-protein
n o q
25.5The maximum amount of protein in grams the recipe can have per serving.
min-fat
n o q
10.1The minimum amount of fat in grams the recipe must have per serving.
max-fat
n o q
25.5The maximum amount of fat in grams the recipe can have per serving.
min-sugar
n o q
10.1The minimum amount of sugar in grams the recipe must have per serving.
max-sugar
n o q
25.5The maximum amount of sugar in grams the recipe can have per serving.
min-fiber
n o q
10.1The minimum amount of fiber in grams the recipe must have per serving.
max-fiber
n o q
25.5The maximum amount of fiber in grams the recipe can have per serving.
min-folate
n o q
30.4The minimum amount of folate in micrograms the recipe must have per serving.
max-folate
n o q
80.9The maximum amount of folate in micrograms the recipe can have per serving.
min-folic-acid
n o q
30.4The minimum amount of folic acid in micrograms the recipe must have per serving.
max-folic-acid
n o q
80.9The maximum amount of folic acid in micrograms the recipe can have per serving.
min-iodine
n o q
30.4The minimum amount of iodine in micrograms the recipe must have per serving.
max-iodine
n o q
80.9The maximum amount of iodine in micrograms the recipe can have per serving.
min-iron
n o q
30.4The minimum amount of iron in milligrams the recipe must have per serving.
max-iron
n o q
80.9The maximum amount of iron in milligrams the recipe can have per serving.
min-zinc
n o q
30.4The minimum amount of zinc in milligrams the recipe must have per serving.
max-zinc
n o q
80.9The maximum amount of zinc in milligrams the recipe can have per serving.
min-magnesium
n o q
30.4The minimum amount of magnesium in milligrams the recipe must have per serving.
max-magnesium
n o q
80.9The maximum amount of magnesium in milligrams the recipe can have per serving.
min-manganese
n o q
30.4The minimum amount of manganese in milligrams the recipe must have per serving.
max-manganese
n o q
80.9The maximum amount of manganese in milligrams the recipe can have per serving.
min-phosphorus
n o q
30.4The minimum amount of phosphorus in milligrams the recipe must have per serving.
max-phosphorus
n o q
80.9The maximum amount of phosphorus in milligrams the recipe can have per serving.
min-potassium
n o q
30.4The minimum amount of potassium in milligrams the recipe must have per serving.
max-potassium
n o q
80.9The maximum amount of potassium in milligrams the recipe can have per serving.
min-sodium
n o q
30.4The minimum amount of sodium in milligrams the recipe must have per serving.
max-sodium
n o q
80.9The maximum amount of sodium in milligrams the recipe can have per serving.
min-selenium
n o q
30.4The minimum amount of selenium in micrograms the recipe must have per serving.
max-selenium
n o q
80.9The maximum amount of selenium in micrograms the recipe can have per serving.
min-copper
n o q
30.4The minimum amount of copper in milligrams the recipe must have per serving.
max-copper
n o q
80.9The maximum amount of copper in milligrams the recipe can have per serving.
min-calcium
n o q
30.4The minimum amount of calcium in milligrams the recipe must have per serving.
max-calcium
n o q
80.9The maximum amount of calcium in milligrams the recipe can have per serving.
min-choline
n o q
30.4The minimum amount of choline in milligrams the recipe must have per serving.
max-choline
n o q
80.9The maximum amount of choline in milligrams the recipe can have per serving.
min-cholesterol
n o q
30.4The minimum amount of cholesterol in milligrams the recipe must have per serving.
max-cholesterol
n o q
80.9The maximum amount of cholesterol in milligrams the recipe can have per serving.
min-fluoride
n o q
30.4The minimum amount of fluoride in milligrams the recipe must have per serving.
max-fluoride
n o q
80.9The maximum amount of fluoride in milligrams the recipe can have per serving.
min-alcohol
n o q
10.1The minimum amount of alcohol in grams the recipe must have per serving.
max-alcohol
n o q
25.5The maximum amount of alcohol in grams the recipe can have per serving.
min-caffeine
n o q
30.4The minimum amount of caffeine in milligrams the recipe must have per serving.
max-caffeine
n o q
80.9The maximum amount of caffeine in milligrams the recipe can have per serving.
min-saturated-fat
n o q
30.4The minimum amount of saturated fat in grams the recipe must have per serving.
max-saturated-fat
n o q
80.9The maximum amount of saturated fat in grams the recipe can have per serving.
min-vitamin-a
n o q
30.4The minimum amount of Vitamin A in IU the recipe must have per serving.
max-vitamin-a
n o q
80.9The maximum amount of Vitamin A in IU the recipe can have per serving.
min-vitamin-c
n o q
30.4The minimum amount of Vitamin C in milligrams the recipe must have per serving.
max-vitamin-c
n o q
80.9The maximum amount of Vitamin C in milligrams the recipe can have per serving.
min-vitamin-d
n o q
30.4The minimum amount of Vitamin D in micrograms the recipe must have per serving.
max-vitamin-d
n o q
80.9The maximum amount of Vitamin D in micrograms the recipe can have per serving.
min-vitamin-e
n o q
30.4The minimum amount of Vitamin E in milligrams the recipe must have per serving.
max-vitamin-e
n o q
80.9The maximum amount of Vitamin E in milligrams the recipe can have per serving.
min-vitamin-k
n o q
30.4The minimum amount of Vitamin K in micrograms the recipe must have per serving.
max-vitamin-k
n o q
80.9The maximum amount of Vitamin K in micrograms the recipe can have per serving.
min-vitamin-b1
n o q
30.4The minimum amount of Vitamin B1 in milligrams the recipe must have per serving.
max-vitamin-b1
n o q
80.9The maximum amount of Vitamin B1 in milligrams the recipe can have per serving.
min-vitamin-b2
n o q
30.4The minimum amount of Vitamin B2 in milligrams the recipe must have per serving.
max-vitamin-b2
n o q
80.9The maximum amount of Vitamin B2 in milligrams the recipe can have per serving.
min-vitamin-b3
n o q
30.4The minimum amount of Vitamin B3 in milligrams the recipe must have per serving.
max-vitamin-b3
n o q
80.9The maximum amount of Vitamin B3 in milligrams the recipe can have per serving.
min-vitamin-b5
n o q
30.4The minimum amount of Vitamin B5 in milligrams the recipe must have per serving.
max-vitamin-b5
n o q
80.9The maximum amount of Vitamin B5 in milligrams the recipe can have per serving.
min-vitamin-b6
n o q
30.4The minimum amount of Vitamin B6 in milligrams the recipe must have per serving.
max-vitamin-b6
n o q
80.9The maximum amount of Vitamin B6 in milligrams the recipe can have per serving.
min-vitamin-b12
n o q
30.4The minimum amount of Vitamin B12 in milligrams the recipe must have per serving.
max-vitamin-b12
n o q
80.9The maximum amount of Vitamin B12 in milligrams the recipe can have per serving.
sort
s o q
meta-scoreThe strategy to sort recipes by.
sort-direction
s o q
ASCWhether to sort ascending or descending (ASC or DESC).
offset
n o q
0The number of recipes to skip, between 0 and 900.
number
n o q
3The number of recipes, between 1 and 100.
api-key
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.apileague.com/search-recipes?query=pasta+with+mushrooms&exclude-ingredients=olives&min-protein=20&number=3
{
    "offset": 0,
    "number": 3,
    "recipes": [
        {
            "id": 654913,
            "title": "Pasta With Chicken and Mushrooms",
            "images": [
                "https://img.spoonacular.com/recipes/654913-312x231.jpg"
            ],
            "nutrition": {
                "nutrients": [
                    {
                        "name": "Protein",
                        "amount": 36.1306,
                        "unit": "g"
                    }
                ]
            }
        },
        {
            "id": 655582,
            "title": "Penne Pasta With Chicken And Mushrooms",
            "images": [
                "https://img.spoonacular.com/recipes/655582-312x231.jpg"
            ],
            "nutrition": {
                "nutrients": [
                    {
                        "name": "Protein",
                        "amount": 40.6552,
                        "unit": "g"
                    }
                ]
            }
        },
        {
            "id": 1096241,
            "title": "Spaghetti with Peas, Mushrooms, and Tomato Sauce",
            "images": [
                "https://img.spoonacular.com/recipes/1096241-312x231.jpg"
            ],
            "nutrition": {
                "nutrients": [
                    {
                        "name": "Protein",
                        "amount": 39.1976,
                        "unit": "g"
                    }
                ]
            }
        }
    ],
    "total_results": 18
}
 Copy Codecurl -X GET 'https://api.apileague.com/search-recipes?query=pasta+with+mushrooms&exclude-ingredients=olives&min-protein=20&number=3' \ -H 'x-api-key: myapikey'

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Frequently Asked Questions

How can I search for recipes using this API?

You can search using natural language queries (e.g., "pasta without mushrooms"), and filter by ingredients, diet, cuisine, meal type, nutrition, intolerances, and more.

What dietary filters are available?

You can filter recipes by various diets such as vegetarian, vegan, gluten-free, ketogenic, and many others. You can also exclude specific ingredients or allergens.

Does the API provide nutritional information for the recipes?

Yes, the API can return detailed nutritional information for each recipe, including macro and micro nutrients, allowing you to sort or filter by healthiness or specific nutrient content.

How is the Search Recipes API different from the Retrieve Recipe API?

The Search Recipes API allows you to find recipes based on ingredients, diets, or queries, while the Retrieve Recipe API provides detailed information for a single recipe using its ID.

Questions? Need Help? Ask Away

Quotas

Calling this endpoint costs
1 token
plus: If add-recipe-information is set to true, one additional token per returned recipe. If fill-ingredients is set to true, one additional token per returned recipe.