---
name: daily-summary
description: Read a user's consumed nutrition totals and goals for a given day from their Eat My Words diary.
---

# daily-summary

Fetch the running nutrition totals for a single day from a user's Eat My Words
diary, alongside the daily goals they've set. Use this to answer questions like
"how many calories have I had today?" or "am I on track for protein?".

## When to use

- The user asks about their totals, remaining allowance, or goal progress for a day.
- You need today's numbers before advising on what to eat next.

This endpoint only **reads** data and does not use AI, so it is free and never
counts against the user's AI budget.

## Endpoint

```
GET https://words.my/api/v1/daily-summary/
```

Headers:

| Header | Value |
| --- | --- |
| `Authorization` | `Api-Key <USER_KEY>` |

Query parameters:

| Param | Required | Notes |
| --- | --- | --- |
| `date` | no | `YYYY-MM-DD`. Defaults to today in the user's timezone. |
| `timezone` | no | IANA name (e.g. `America/Toronto`). Controls which calendar day the totals are bucketed into. Falls back to the user's profile timezone, then UTC. |

## Response

Success (HTTP 200):

```json
{
  "date": "2026-05-06",
  "totals": {
    "calories": 1420.0,
    "carbohydrates": 160.0,
    "proteins": 95.0,
    "fats": 48.0,
    "fiber": 22.0,
    "sugars": 40.0,
    "sodium": 1800.0,
    "water": 1500.0,
    "alcohol": 0.0
  },
  "goals": {
    "calories": 2000,
    "carbohydrates": 220,
    "proteins": 120,
    "fats": 60,
    "water": 2500
  }
}
```

`totals` are the amounts consumed so far that day. `goals` are the user's
targets, or `null` for any goal they haven't set. Calories are kcal; macros,
water, and alcohol are grams; sodium is mg.

## How to summarize for the user

- Lead with the headline the user asked about (usually calories or the macro in question).
- When a matching goal exists, frame the number as progress: `1,420 / 2,000 kcal (71%) — 580 left`.
- If the relevant goal is `null`, just report the total and optionally note no goal is set.
- Round calories to whole numbers; macros to one decimal below 10 g, whole numbers above.

## Errors

| Status | Cause | Recovery |
| --- | --- | --- |
| 401 / 403 | Missing or invalid `Authorization` header | Ask the user to create an API key at their profile. |
| 400 | `date` is not `YYYY-MM-DD` | Fix the date format. |

## Related endpoints

- `POST /api/v1/logs/` — log food from a natural-language description (see `log-food.md`).
- `GET /api/v1/logs/` — list individual diary entries (filter by `date=YYYY-MM-DD`).
