Skip to main content

Nutrition Calculation

The nutrition calculation endpoint is Saturday’s core product. It takes an activity description and returns a personalized fuel prescription — carbohydrate, hydration, and electrolyte targets — with safety guardrails applied.

Progressive enrichment

Saturday works with whatever data you have. More data produces more accurate prescriptions — but even minimal inputs return useful results.

Minimal inputs

The bare minimum for a calculation:
This returns a prescription with a low confidence_score. The numbers are based on population-level defaults for the given activity type and body weight.

Standard inputs

Add intensity and environmental conditions for a meaningfully better prescription:
Thermal stress dramatically affects hydration and sodium needs. A 3-hour ride at high thermal stress requires very different fueling than the same ride in cool conditions.

Comprehensive inputs

For the highest accuracy, include an athlete reference:
When you include an athlete_id, Saturday pulls their stored profile — sweat level, saltiness, carb experience, fitness level, and past activity feedback. This is where prescriptions become genuinely personalized.
The enrichment path: Start with minimal inputs to get integrated fast, then progressively add more data as your integration matures. Every additional field improves accuracy.

Understanding the response

Confidence score

The safety.confidence_score (0.0-1.0) indicates how personalized the prescription is:

Comparing across conditions

To compare fueling across different conditions (e.g. a cool morning vs. a hot afternoon), call POST /v1/nutrition/calculate once per scenario and diff the results yourself, or use POST /v1/nutrition/calculate/batch to submit up to 50 scenarios in a single request.
Two prescription shapes. The calculate endpoints return a flat response (carb_g_per_hr, sodium_mg_per_hr, … with a nested safety block). The stored-prescription read (GET /v1/athletes/{id}/activities/{id}/prescription) returns a wrapped response: { "prescription": { … }, "safety": { … } }. Read the fields accordingly depending on which endpoint you called.

Calculation timing

Running the calculator is a deliberate computation window, not an instant lookup — the same processing experience athletes see in the Saturday app:
  • Single calculation (POST /v1/nutrition/calculate, POST .../activities/{id}/calculate): expect roughly 1–3 seconds, scaling gently with activity duration. Recalculating an activity that already has a prescription takes about half that.
  • Batch (POST /v1/nutrition/calculate/batch): each scenario adds roughly half a single calculation’s time. The response headers arrive immediately with X-Batch-Estimated-Ms — the expected total processing time — so you can size progress indicators before the body lands. The completed body includes estimated_ms and elapsed_ms.
  • Estimate without calculating: send the same batch payload with "estimate_only": true to get estimated_ms back instantly, with no calculations run. Useful when your HTTP client can’t read streamed headers early.
  • Reads are instant. Fetching a stored prescription (GET .../prescription) never carries a computation window.
Show a progress indicator during calculation. Athletes trust a prescription more when they see it being computed. Use the calculation window to display a “calculating fueling plan…” state rather than a spinner-free freeze.

Teaser vs. full responses

Responses depend on the athlete’s Saturday subscription status:
  • Subscribed athletes get exact numbers: "carb_g_per_hr": 72
  • Free/teaser athletes get ranges: "carb_range_g_per_hr": "55-85"
See Freemium Model for implementation details.

Safety

Every calculation response includes a safety block. This is non-negotiable — Saturday is a nutrition API for athletes, and bad recommendations can cause real harm. See Safety for the full guide on safety fields, risk levels, and display requirements.
Safety data is never gated behind subscription status. Even teaser responses include complete safety metadata.

Supported activity types

Use GET /v1/activity-types for the complete list with descriptions.
Graduated precision (2026-06): every calculation response now carries a precision object — profile_complete, impact-sorted missing_fields, and an onboarding invite URL. Exact numbers require a complete fueling profile; incomplete profiles get honest bands (never wider than teaser ranges). See Athlete Onboarding.