Inspiration
I love to cook, especially unhealthy foods like pastries and creamy pasta, but my parents always say they need to eat healthier. I tried to find healthier recipes online, but I realized how hard it was to find recipes that replaced butter with olive oil, and I didn't know the ratio. I decided to make cooking healthier and more accessible by helping people easily modify recipes for their dietary needs or preferences without having to manually search for substitutions. It made the process more efficient, so people wouldn't have to spend hours searching for healthy recipes.
What it does
The website allows users to paste a recipe URL and request ingredient substitutions, such as healthier alternatives or diet-specific changes. Gemini AI then fetches the recipe and generates a modified version, displayed on a clean results page.
How I built it
I used Python and Flask for the backend and HTML/CSS for the frontend. The Gemini API with its URL context tool fetches and rewrites recipes based on user input, and Markdown formatting is rendered in the results page for readability.
Challenges I ran into
I had to figure out how to parse Gemini’s structured responses (candidates → content → parts → text) and correctly display them as HTML. Ensuring the API could fetch URLs reliably and handle different recipe sites was also tricky.
Accomplishments that I am proud of
I successfully integrated AI to dynamically rewrite recipes with user-specified substitutions and made the output visually clean and easy to read. The app works end-to-end and handles real recipe URLs.
What I learned
I learned how to work with a modern AI API, handle structured responses, integrate backend logic with a web frontend, and render Markdown safely in Flask templates. I also improved my understanding of web forms and user input handling.
What's next for Substitute Ingredients
I plan to add features like multiple substitution options, nutritional info adjustments, and possibly a history or favorites system so users can save and compare modified recipes.
Log in or sign up for Devpost to join the conversation.