# Recipe Base API Documentation ## Base URL https://recipe-base.wearemachina.com ## Endpoints ### 1. Get Recipes (List) - **GET** `/recipes` - **Description:** Retrieve a paginated list of recipes with lightweight metadata. - **Parameters:** `limit` (default 50), `offset` (default 0) - **Response:** ```json { "recipes": [ { "id": "uuid", "name": "Recipe Title", "image": "https://example.com/image.jpg", "description": "Short description...", "cook_time": "PT1H", "prep_time": "PT15M" } ], "count": 120 } ``` ### 2. Get Recipe Details - **GET** `/recipes/:id` - **Description:** Retrieve full details for a specific recipe. Includes ingredients, instructions, and JIT nutrition enrichment. - **Parameters:** `id` (UUID) - **Response:** ```json { "id": "uuid", "name": "Recipe Title", "recipe_ingredients": ["1 cup flour", "2 eggs"], "recipe_instructions": ["Mix ingredients.", "Bake at 350F."], "nutrition": { "calories": 200, "protein": 10, "fat": 5, "carbohydrate": 30 }, "qa_status": "verified" } ``` ### 3. Search Recipes - **GET** `/search` - **Description:** Hybrid intelligent search. - **Parameters:** - `q` (string): Fuzzy search term. - `ingredients` (string): Ingredient filter. - `match_all` (boolean): `true` = AND logic. - `full` (boolean): `true` = Return full recipe details. - **Response:** List of recipes. ### 4. Nutrition Analysis (Natural Language) - **POST** `/nutrition/analyze` - **Description:** Analyze a list of ingredients using USDA Foundation Data. - **Body:** `{ "ingredients": ["200g chicken breast", "1 cup rice"] }` - **Response:** ```json { "total": { "calories": 500, "protein": 40, ... }, "breakdown": [ { "ingredient": "200g chicken breast", "stats": { ... } } ] } ``` ### 5. Batch Enrich - **POST** `/recipes/enrich` - **Description:** Retrieve full details for a list of IDs. - **Body:** `{ "ids": ["uuid", "uuid"] }` ### 6. System Health (Admin) - **GET** `/health` - **Response:** `{ "stats": { "total": 100, "verified": 80 }, "recent": [ ... ] }` ### 7. Start Crawl (Admin) - **POST** `/crawl` - **Body:** `{ "url": "https://example.com/recipes" }`