https://github.com/schollz/ingredients
Extract recipe ingredients from any recipe website on the internet.
https://github.com/schollz/ingredients
cooking extractor ingredients recipes tagging
Last synced: about 2 months ago
JSON representation
Extract recipe ingredients from any recipe website on the internet.
- Host: GitHub
- URL: https://github.com/schollz/ingredients
- Owner: schollz
- License: mit
- Created: 2019-07-07T17:25:53.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-11-24T14:23:18.000Z (over 3 years ago)
- Last Synced: 2025-02-16T12:58:36.328Z (over 1 year ago)
- Topics: cooking, extractor, ingredients, recipes, tagging
- Language: HTML
- Homepage: https://schollz.com/blog/ingredients/#try
- Size: 1.54 MB
- Stars: 129
- Watchers: 5
- Forks: 27
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# ingredients
This is a Golang library for *ingredient tagging* and *extraction* for **any recipe on the internet**. This library compartmentalizes and improves aspects of recipe extraction that I did previously with [schollz/meanrecipe](https://github.com/schollz/meanrecipe) and [schollz/extract_recipe](https://github.com/schollz/extract_recipe).
Try it online: https://schollz.com/blog/ingredients/#try
## Usage
### Online API
You can use it online, just do `GET https://ingredients.schollz.now.sh/?url=X` where `X` is a URL to a recipe website.
```
$ curl https://ingredients.schollz.now.sh/?url=https://cooking.nytimes.com/recipes/12320-apple-pie
```
### Command line
You can use it from the command line! If you [download a release](https://github.com/schollz/ingredients/releases/latest), you can also use it from the command line:
```
$ ingredients https://www.tasteofhome.com/recipes/banana-chocolate-chip-cookies/
```
### Go library
You can use as a library.
```
$ go get github.com/schollz/ingredients
```
Pick a random website, like [JoyFoodSunshine](https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/), and you can extract the ingredients:
```go
r, _ := ingredients.NewFromURL("https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/")
fmt.Println(r.IngredientList())
// Output:
// 1 cup butter (salted)
// 1 cup sugar (white)
// 1 cup brown sugar (light)
// 2 tsp vanilla (pure)
// 2 whole eggs
// 3 cups flour (all purpose)
// 1 tsp baking soda
// 1/2 tsp baking powder
// 1 tsp salt (sea)
// 2 cups chocolate chips
```
Please make an issue if you find a problem.
## How does it work?
See my blog post about it: [schollz.com/blog/ingredients](https://schollz.com/blog/ingredients).
## Develop
If you modify the `corpus/` information then you will need to run
```
$ go generate
```
before using the library again.
## Contributing
Pull requests are welcome. Feel free to...
- Revise documentation
- Add new features
- Fix bugs
- Suggest improvements
## License
MIT