In order to turn a web page into structured data, I needed a few different things. First, remember that Google's Gemini service supports the ability to use JSON Schema to tell the API how to return a result. This flexibility allows for better representation of recipes and their ingredients using a structured format.
Crafting the schema correctly can be a bit of work, but using the JSON Schema website for help and examples simplifies the process, enabling developers to effectively define various properties of recipes.
As I'm working with recipes, I defined my schema with properties such as name, ingredients, and steps. This approach outlines a clear structure for the data, catering to how recipes are typically formatted.
This could be fleshed out more, for example, with a duration property. As always, take my blog posts as a starting point and if you build on it, let me know!
Collection
[
|
...
]