Skip to main content

Endpoint

GET /diary/summary/month/:year/:month

Authentication

This endpoint requires authentication via Bearer token.
Authorization: Bearer <token>

Path Parameters

year
string
required
Year in YYYY format (e.g., “2024”)
month
string
required
Month as a number from 1-12 (e.g., “3” for March, “12” for December)

Response

success
boolean
Indicates if the request was successful
data
object
Month summary data
year
number
The requested year
month
number
The requested month (1-12)
days
array
Array of day summaries for each day in the month
date
string
Date in YYYY-MM-DD format
dayOfMonth
number
Day number (1-31)
mealCount
number
Number of meals logged on this day
symptomCount
number
Number of symptoms logged on this day
dayStatus
string
Overall status: great, good, okay, bad, terrible, or no_data
worstIntensity
number
Highest symptom intensity (1-5), or null if no symptoms
problematicFoods
array
List of problematic foods consumed this day
monthStats
object
Overall statistics for the month
totalMeals
number
Total meals logged in the month
totalSymptoms
number
Total symptoms logged in the month
daysWithData
number
Number of days with at least one entry
daysWithSymptoms
number
Number of days with at least one symptom
avgSymptomsPerDay
number
Average number of symptoms per day (for days with data)
greatDays
number
Number of days with “great” status
badDays
number
Number of days with “bad” or “terrible” status

Examples

Get summary for March 2024

curl -X GET "https://api.ceboelha.com/diary/summary/month/2024/3" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get summary for current month

YEAR=$(date +%Y)
MONTH=$(date +%-m)
curl -X GET "https://api.ceboelha.com/diary/summary/month/$YEAR/$MONTH" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get summary for previous month

curl -X GET "https://api.ceboelha.com/diary/summary/month/2024/2" \
  -H "Authorization: Bearer YOUR_TOKEN"

Get summary for December (year-end review)

curl -X GET "https://api.ceboelha.com/diary/summary/month/2023/12" \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "success": true,
  "data": {
    "year": 2024,
    "month": 3,
    "days": [
      {
        "date": "2024-03-01",
        "dayOfMonth": 1,
        "mealCount": 3,
        "symptomCount": 0,
        "dayStatus": "great",
        "worstIntensity": null,
        "problematicFoods": []
      },
      {
        "date": "2024-03-02",
        "dayOfMonth": 2,
        "mealCount": 4,
        "symptomCount": 1,
        "dayStatus": "good",
        "worstIntensity": 2,
        "problematicFoods": []
      },
      {
        "date": "2024-03-03",
        "dayOfMonth": 3,
        "mealCount": 0,
        "symptomCount": 0,
        "dayStatus": "no_data",
        "worstIntensity": null,
        "problematicFoods": []
      },
      {
        "date": "2024-03-15",
        "dayOfMonth": 15,
        "mealCount": 4,
        "symptomCount": 2,
        "dayStatus": "okay",
        "worstIntensity": 3,
        "problematicFoods": [
          {
            "foodId": 3456,
            "foodName": "Feijão preto"
          }
        ]
      }
    ],
    "monthStats": {
      "totalMeals": 95,
      "totalSymptoms": 12,
      "daysWithData": 28,
      "daysWithSymptoms": 8,
      "avgSymptomsPerDay": 0.43,
      "greatDays": 20,
      "badDays": 2
    }
  }
}

Calendar Display

This endpoint is specifically designed for calendar views. Use the days array to render a monthly calendar where:
  • Each day shows mealCount and symptomCount
  • Color-code days by dayStatus
  • Show indicator icons for days with problematic foods
  • Gray out days with no_data status

Status Color Recommendations

StatusSuggested Color
greatGreen (#10B981)
goodLight Green (#34D399)
okayYellow (#FBBF24)
badOrange (#FB923C)
terribleRed (#EF4444)
no_dataGray (#9CA3AF)

Month Statistics

The monthStats object provides valuable insights:
  • Adherence: daysWithData / total days shows how consistently the user is tracking
  • Symptom Frequency: daysWithSymptoms / daysWithData shows percentage of symptomatic days
  • Progress: Compare greatDays and badDays across months to track improvement
  • Average Severity: Use avgSymptomsPerDay to understand overall symptom burden

Performance Notes

  • This endpoint efficiently aggregates data for an entire month in a single request
  • Results are typically cached for improved performance
  • Use this instead of making 30+ individual day summary requests

Build docs developers (and LLMs) love