Py Allrecipes is a Python package for searching and extracting structured recipe data from Allrecipes.com.
- Search for recipes by keyword
- Extract ingredients, steps, times, servings, and yield from any recipe page
- Output is robust and structured for easy use in your own projects
search_recipes(query): Search Allrecipes and get a list of recipe titles, URLs, and ratingsget_recipe(url): Fetch and parse a recipe page for all details (ingredients, steps, times, servings, yield)
import py_allrecipes
results = py_allrecipes.search_recipes('chocolate cake')
url = results[0]['url']
recipe = py_allrecipes.get_recipe(url)
print(recipe['title'])
print(recipe['ingredients'])
print(recipe['steps'])
print(recipe['details'])See the full documentation for more details and usage examples.
MIT