Import
The import
command fetches recipes from websites and automatically converts them to Cooklang format. It supports hundreds of popular recipe websites and extracts ingredients, instructions, and metadata intelligently.
Requires OPENAI_API_KEY
environment variable set to perform the conversion to Cooklang. Without the key you still can downlad recipe original content, but it won't be converted to Cooklang.
Note that you can use cook.md converter if you don't have OpenAI key.
Basic Usage
This downloads the recipe and outputs it in Cooklang format into stdout.
Supported Websites
The importer works with most recipe websites that use standard recipe markup, including:
- AllRecipes
- BBC Good Food
- Bon Appétit
- Serious Eats
- Food Network
- NYT Cooking
- Simply Recipes
- And hundreds more...
Any site using Recipe Schema.org markup should work automatically.
Importing Recipes
Basic Import
Output (Cooklang format):
Save to File
Redirect output to save:
Import Without Conversion
Get the raw extracted data without converting to Cooklang:
Output:
Metadata Options
Control how metadata is included in the output:
Metadata Extraction
Automatically extracts:
- Title
- Description
- Images
- Servings/Yield
- Prep/Cook/Total time
- Source URL
- Author
- Tags/Categories
- Cuisine
- Course
- Difficulty
- Ratings
- Nutrition information
- And more depending on the source
Working with Different Sites
Paywalled Sites (TODO)
Some sites require authentication:
Sites with Anti-Scraping (TODO)
For sites that block automated access:
- Save the webpage locally
- Extract manually or use browser tools
- Convert saved HTML
Non-Standard Sites
For sites without proper markup:
Troubleshooting
Import Fails
Common issues and solutions:
- 403 Forbidden: Site blocks bots. Try saving page locally first.
- No recipe found: Site might not use standard markup. Use
--skip-conversion
. - Partial import: Some sites split recipes across pages. May need manual combination.
Formatting Issues
After import, you might need to:
- Adjust quantities for metric/imperial
- Fix ingredient names for your region
- Correct timing formats
- Add missing metadata
Best Practices
Verify Imports
Always review imported recipes:
- Check ingredient quantities make sense
- Verify cooking times
- Ensure steps are complete
- Add any missing equipment or techniques
Maintain Attribution
Keep source information: