A Python package for extracting recipe data from cooking websites. Parses recipe information from either standard HTML structure, Schema markup (including JSON-LD, Microdata, and RDFa formats) or OpenGraph metadata.
The package provides a simple and consistent API for retrieving data such as ingredients, instructions, cooking times, and more.
Compatible with the Python versions listed above. This package does not circumvent or bypass any bot protection measures implemented by websites.
pip install recipe-scrapers
from recipe_scrapers import scrape_me
scraper = scrape_me("https://www.allrecipes.com/recipe/158968/spinach-and-feta-turkey-burgers/")
scraper.title()
scraper.instructions()
scraper.to_json()
# for a complete list of methods:
# help(scraper)
This package is focused exclusively on HTML parsing.
For advanced implementations, you'll need to implement your own solution for fetching recipe HTMLs and managing network requests. The library works best when you provide both the HTML content and its source domain.
You are encouraged to use our scrape_html method:
from recipe_scrapers import scrape_html
We support a wide range of recipe websites out of the box. Check our supported sites list for the full list.
You can also get the full list programmatically with:
from recipe_scrapers import SCRAPERS
SCRAPERS.keys()
We welcome contributions! Please read our contribution guide to get started.
To all the contributors who help make this project better!
Have an idea for using recipe-scrapers? Check out our project ideas wall for inspiration or to share your own project!