Overview
This endpoint returns comprehensive statistics for the last 7 days, including diary entries, symptoms, meals, and comparisons with the previous week.Endpoint
Authentication
This endpoint requires authentication via Bearer token.Response
Indicates if the request was successful
Weekly summary statistics
Statistics Explained
Days Logged
Counts unique calendar dates with at least one diary entry (meal or symptom) in the last 7 days.Total Symptoms
Sum of all symptom entries, regardless of type or intensity.Average Intensity
Mean intensity value across all symptom entries, on a scale of 0-10. Rounded to one decimal place for readability.Unique Foods
Counts distinct foods consumed across all meals. The same food eaten multiple times is counted once.Weekly Comparison
Percentage changes are calculated as:- Positive values indicate an increase
- Negative values indicate a decrease (improvement for symptoms/intensity)
- If previous week had zero values, returns 100 if current has any values, 0 otherwise
Streak
Number of consecutive days with at least one diary entry. Resets to 0 if a day is missed.Example Request
Example Response
Interpreting Results
In the example above:- User logged data on 6 out of 7 days
- Recorded 8 symptom entries with an average intensity of 4.2/10
- Logged 18 meals containing 42 different foods
- Symptoms decreased by 25% compared to previous week (improvement)
- Average intensity decreased by 15% (improvement)
- User has a 6-day streak of consecutive logging
Error Responses
401 Unauthorized
Returned when the request is missing or has an invalid authentication token.Implementation Notes
- All date ranges use UTC timezone with proper day boundaries (00:00:00 to 23:59:59)
- Current week is defined as the last 7 complete days from today
- Previous week is the 7 days immediately before the current week
- Percentage comparisons handle edge cases (division by zero) gracefully
- Streak data is retrieved from user statistics, updated on each diary entry
- Average intensity is rounded to 1 decimal place for better UX