---
agentTools:
  projectIndex: https://ive-been-cooking.readme.io/llms.txt
---

# Retrieve a random recipe.

Returns a random recipe from the recipe collection.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "I've Been Cooking API",
    "description": "API to search for and retrieve recipes from the I've Been Cooking website.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.ivebeen.cooking",
      "description": "Main (production) server"
    }
  ],
  "paths": {
    "/recipes/random": {
      "get": {
        "operationId": "getRandomRecipe",
        "summary": "Retrieve a random recipe.",
        "description": "Returns a random recipe from the recipe collection.",
        "responses": {
          "200": {
            "description": "A JSON object containing a randomly selected recipe.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Recipe"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Recipe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the recipe."
          },
          "title": {
            "type": "string",
            "description": "Title of the recipe."
          },
          "slug": {
            "type": "string",
            "description": "URL-friendly version of the title."
          },
          "content": {
            "type": "string",
            "description": "Detailed HTML content of the recipe, including history, ingredients, and preparation steps."
          },
          "short_description": {
            "type": "string",
            "description": "Brief description of the recipe."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of tags related to the recipe (e.g., \"Vegetarian\", \"Summer\")."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date and time the recipe was added."
          },
          "likes": {
            "type": "integer",
            "description": "Number of likes the recipe has received."
          },
          "shares": {
            "type": "integer",
            "description": "Number of times the recipe has been shared."
          },
          "attributes": {
            "type": "object",
            "properties": {
              "ingredients": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of ingredients used in the recipe."
              },
              "meal_type": {
                "type": "string",
                "description": "Type of meal (e.g., main course, appetizer)."
              },
              "time_of_day": {
                "type": "string",
                "description": "Suitable time of day for the meal (e.g., afternoon)."
              },
              "dietary_preferences": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Dietary preferences (e.g., Vegetarian, Gluten-free)."
              },
              "nutritional_properties": {
                "type": "object",
                "properties": {
                  "protein": {
                    "type": "number",
                    "description": "Protein content in grams."
                  },
                  "fiber": {
                    "type": "number",
                    "description": "Fiber content in grams."
                  },
                  "sugar": {
                    "type": "number",
                    "description": "Sugar content in grams."
                  },
                  "calorie": {
                    "type": "number",
                    "description": "Calories per serving."
                  },
                  "sodium": {
                    "type": "number",
                    "description": "Sodium content in milligrams."
                  },
                  "saturated_fat": {
                    "type": "number",
                    "description": "Saturated fat content in grams."
                  },
                  "unsaturated_fat": {
                    "type": "number",
                    "description": "Unsaturated fat content in grams."
                  },
                  "trans_fat": {
                    "type": "number",
                    "description": "Trans fat content in grams."
                  },
                  "cholesterol": {
                    "type": "number",
                    "description": "Cholesterol content in milligrams."
                  },
                  "carbs": {
                    "type": "number",
                    "description": "Carbohydrates content in grams."
                  }
                }
              },
              "serving_size": {
                "type": "string",
                "description": "Serving size description."
              },
              "servings": {
                "type": "integer",
                "description": "Number of servings."
              },
              "country_of_origin": {
                "type": "string",
                "description": "Country where the recipe originates."
              },
              "preparation_time": {
                "type": "integer",
                "description": "Preparation time in minutes."
              },
              "complexity": {
                "type": "integer",
                "description": "Complexity rating of the recipe (e.g., 1-5 scale)."
              },
              "cost": {
                "type": "integer",
                "description": "Cost rating of the recipe (e.g., 1-5 scale)."
              }
            }
          },
          "image_url": {
            "type": "string",
            "description": "URL to an image of the recipe."
          },
          "rating": {
            "type": "integer",
            "description": "Rating of the recipe (e.g., 1-5 scale)."
          },
          "total_reviews": {
            "type": "integer",
            "description": "Total number of reviews for the recipe."
          },
          "reviews": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "Review identifier."
                },
                "recipe_id": {
                  "type": "integer",
                  "description": "Associated recipe ID."
                },
                "first_name": {
                  "type": "string",
                  "description": "Reviewer's first name."
                },
                "last_name": {
                  "type": "string",
                  "description": "Reviewer's last name."
                },
                "review": {
                  "type": "string",
                  "description": "Text of the review."
                },
                "rating": {
                  "type": "integer",
                  "description": "Rating given by the reviewer (e.g., 1-5 scale)."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Date and time the review was posted."
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 252,
      "2": 188,
      "3": 88,
      "4": 165,
      "5": 163,
      "6": 255,
      "7": 0,
      "8": 18,
      "9": 48,
      "10": 196,
      "11": 157
    }
  }
}
```