Intakes History

Query a user's food diary between dates and retrieve totals and summaries per day or week. Power calendars, streaks, and progress dashboards.

Plan & Token Requirements

Feature available in the following LogMeal Plans:

Analyse
Monitor
Recommend
Custom

Accessible by the following User Types:

⚫ APICompany | šŸ”“ APIUser | šŸ”µ APIUserManager

What It Does

Intakes History provides access to a user's logged meals (intakes) over time and their nutritional roll‑ups.
You can fetch the list of intakes between two datetimes (including per‑intake nutrients and ingredients), get daily/weekly summaries, and compute total intake by day to drive progress UIs.
Food intakes include image-based food recognition requests, manual inputs, intakes based on barcode scans, personal favorites or custom recipes. See the complete list of ways to insert food intakes.

dishes to be included in the nutritional history calendar
intake history food diary list card

When to Use It / Outcomes

  • You’re building a food diary.
  • You want daily or weekly dashboards showing totals and trends.
  • You need to check if a user has any intake on a given day (for reminders/streaks).
  • Output: JSON containing intake entries with nutrients and ingredients; or summaries/totals for the requested period.

Feature-Specific Details

  • Date/Time filters: Use date_from and date_to (format "%Y/%m/%d, %H:%M:%S") to list intakes in a period.
  • Daily/Weekly summaries: Provide aggregated nutrient values for a specific date ("%Y/%m/%d") or week starting from a given date.
  • Totals by day: Compute the sum of nutrients consumed from images uploaded on a date (24‑hour span).
  • Language: Localize dish and ingredient labels with the language parameter (e.g., eng, spa, ita, etc.). If no language is provided, the user-specific language will be used.
  • User scope: For šŸ”µ APIUserManager and ⚫ APICompany, pass user_id to query a specific user; for šŸ”“ APIUser, it defaults to the token’s user.
  • Timezone: History endpoints apply the platform’s date boundaries; align UI with the user’s timezone for consistent ā€œtoday/this weekā€ views.
  • Water tracking: GET /history/getIntakesList includes an is_water flag per intake and a top-level total_water object that separates water-only entries from configured fluid ingredients in other intakes. See Manual Water Intake Tracking.
  • Partial responses: History responses include is_complete and failed_image_ids. When is_complete is false, the returned totals and intakes_list exclude the listed images; clients can display the available data and retry later.
  • Manager batching: APIUserManager and APICompany integrations should prefer POST /history/getIntakesListBatch instead of issuing simultaneous single-user requests. The body contains user_ids, date_from, and date_to, and accepts at most five users.

Related Endpoints

Use the following endpoints to retrieve intakes history and summaries:

  • GET /history/getIntakesList → ⚫ šŸ”“ šŸ”µ List all intakes with nutrients & ingredients between date_from and date_to.
  • POST /history/getIntakesListBatch → ⚫ šŸ”µ Retrieve histories for up to five managed users in one bounded request. Users are processed sequentially and results are keyed by user ID.
  • GET /intake → ⚫ šŸ”“ šŸ”µ Retrieve all info for a specific intake including nutrients, ingredients, etc.
  • GET /history/getDailySummary → ⚫ šŸ”“ šŸ”µ Daily summary for a given date ("%Y/%m/%d").
  • GET /history/getWeeklySummary → ⚫ šŸ”“ šŸ”µ Weekly summary starting at date ("%Y/%m/%d").
  • GET /history/getTotalIntakeByDay → ⚫ šŸ”“ šŸ”µ Totals for today (24h window).
  • GET /history/getTotalIntakeByDay/{date} → ⚫ šŸ”“ šŸ”µ Totals for a specific date (YYYY-MM-DD).
  • GET /history/hasIntake → ⚫ šŸ”“ šŸ”µ Check presence/number of intakes on a date or date range.

Energy contribution fields

In /history/getIntakesList and /intake/\{imageId\}, energy-contributing nutrients include %EC (energy contribution) fields inside nutritional_info.totalNutrients.

For example:

"PROCNT": {
  "label": "Protein",
  "quantity": 34.75,
  "unit": "g",
  "energy_kcal": 139.0,
  "energy_factor_kcal_per_g": 4.0,
  "energy_contribution_percentage": 10.63
}

The percentage is calculated against the calories of that individual intake.


Typical Workflow

  1. Choose the view: list (date range), summary (day/week), or total (by day).
  2. Call the endpoint with the appropriate parameters (date_from/date_to, date, user_id, language).
  3. Parse response: render intake cards or aggregated totals in charts.
  4. Store & analyze: persist results to power streaks, reminders, and trend analytics.

Did this page help you?