Skip to content

Stats API

Stats answer household questions from History: what the family plans and cooks most, what is new, and when a Recipe was last made. Nothing is stored. Every request computes from Entries using the Meal Space's Planning timezone, assumed completion, and the end of each replacement chain (D-143, D-176).

Method and pathScopeBehavior
GET /api/v1/meal-spaces/{groupId}/stats?range=30dreadRankings for one Meal Space and range.
GET /api/v1/meal-spaces/{groupId}/recipes/{recipeId}/statsreadLast made and all-time counts for one Recipe.

range is 30d, 90d, 1y, or all. The first three are rolling windows that include Today: Today minus 29 days, Today minus 89 days, and the same date one calendar year earlier. all has no lower bound.

Access

Stats need stats.read. In a shared Meal Space every member, including a Viewer, may read them while the space is sponsored or in paid grace. A read-only shared space returns sponsorship_required or meal_space_read_only. A Personal Meal Space needs the owner's Pro entitlement and otherwise returns pro_required. Raw History stays available in all of these cases; see the History API.

Figures

  • Most planned counts Recipe Entries dated today or earlier, including ones later skipped or replaced.
  • Most cooked counts Recipe Entries that end their replacement chain and are completed or past and still planned. Leftovers never count toward the Recipe they came from.
  • New Recipes tried lists Recipes whose first made occurrence in this Meal Space falls inside the range.
  • Rankings return at most ten Recipes. Ties order by the latest qualifying date, then title. Variations roll into their parent Recipe once they exist.
  • A deleted Recipe drops out of every ranking. Its Entries stay in History with their saved titles.
  • An empty range returns empty lists, never zero-filled rows.

get_recipe_stats returns last_made_on (or null), times_made, and times_planned across all time for one Recipe, under the same rules.