SnapCook is a webapp that helps you figure out what meals you can cook with the ingredients in your fridge. Now built with FastAPI backend for better scalability and API access.
- Upload a photo of your fridge via REST API
- Automatically detect ingredients using OpenAI API
- Generate a clean list of items with confidence scores
- Get recipe suggestions based on available ingredients
- RESTful API for integration with other applications
- Backend: FastAPI with OpenAI integration
- Frontend: Simple HTML/JavaScript interface
- API: RESTful endpoints for ingredient detection and recipe suggestions
- Clone this repository
- Create a virtual environment and install dependencies:
python -m venv .venv source .venv/bin/activate # Windows: .venv\\Scripts\\activate pip install --upgrade pip pip install .
- Create a
.envfile in the project root to store your API keys (never commit this file):OPENAI_API_KEY=sk-xxxxxxx - Run the FastAPI backend:
The API will be available at
uvicorn backend.main:app --reload
http://localhost:8000
- Open
frontend/index.htmlin your web browser - Or serve it with a simple HTTP server:
Then visit
# Python 3 cd frontend python -m http.server 3000
http://localhost:3000
Health check endpoint
Upload an image and detect ingredients
- Body: Form data with
file(image) and optionaluser_hint(string) - Response: JSON with ingredients list and processing time
Get recipe suggestions based on ingredient list
- Body: JSON array of ingredient names
- Response: JSON with recipe suggestions
Combined endpoint: detect ingredients and get recipe suggestions
- Body: Form data with
file(image) and optionaluser_hint(string) - Response: JSON with ingredients and recipe suggestions
- Manual editing of detected and missing ingredients
- More accurate food recognition
- Recipe database integration
- Support for multiple fridge photos
- Saving favorite recipes
- Multi-image support to scan shelves individually and merge results.
- Track quantities and freshness dates with another photo or OCR from labels.
This project is licensed under the MIT License.