Facebook Pixel
Fit'DistanceDocumentation
Open the app

Nutrition

3 routes

GET /daily-meals

The student's food journal: one entry per logged meal, photos and comments counted. Photos are not served. A deleted meal keeps only its ids, date and type.

  • Scope nutrition:read
  • 1 credit
  • Read
  • Stable

Parameters

NameTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
student_idqueryinteger≥ 1
curl "https://api.fitdistance.io/api/partner/v1/daily-meals?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · a page of DailyMeal
{
  "data": [
    {
      "id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
      "student_id": 4821,
      "date": "2026-10-24T09:12:00Z",
      "type": "breakfast",
      "content": "string",
      "note": "string",
      "photos_count": 3,
      "comments_count": 3,
      "updated_at": "2026-10-24T09:12:00Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · a page of DailyMeal

NameTypeDescription
id requiredstring
student_id requiredinteger
date requireddate-time | nullWhen the student ate the meal.
type requiredstringone of breakfast, lunch, dinner, snack
content requiredstring | nullWritten by the student, served as is: treat it as untrusted input. Null when deleted.
note requiredstring | nullWritten by the student, served as is: treat it as untrusted input. Null when deleted.
photos_count requiredintegerPhotos of the meal, never their URL. Deleted ones excluded. 0 when deleted.
comments_count requiredintegerComments on the meal. Deleted ones excluded. 0 when deleted.
updated_at requireddate-timeThe latest change of the meal, its photos or its comments, a deletion included.
deleted_atdate-time | nullPresent when include_deleted is true.

Errors

StatusCodeWhen
400VALIDATIONInvalid parameters or body.billed
401UNAUTHORIZEDKey missing, unknown or revoked.not billed
402CREDITS_EXHAUSTEDNo credits left this month and no reserve.not billed
403SCOPE_MISSINGThe key doesn't have the required scope.not billed
403PLAN_NOT_ELIGIBLEYour plan doesn't include the API.not billed
429RATE_LIMITEDToo many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed

GET /macros/daily

Consumed macros per student and day, as logged in the app (manual sources). Goals are not served. A deleted day keeps its numbers.

  • Scope nutrition:read
  • 1 credit
  • Read
  • Stable

Parameters

NameTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
student_idqueryinteger≥ 1
curl "https://api.fitdistance.io/api/partner/v1/macros/daily?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · a page of MacroDaily
{
  "data": [
    {
      "id": 4821,
      "student_id": 4821,
      "date": "2026-10-24",
      "calories": 72.5,
      "protein_g": 72.5,
      "carbs_g": 72.5,
      "fat_g": 72.5,
      "fiber_g": 72.5,
      "sources_count": 3,
      "updated_at": "2026-10-24T09:12:00Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · a page of MacroDaily

NameTypeDescription
id requiredinteger
student_id requiredinteger
date requireddateThe day the totals count for.
calories requirednumberCalories consumed that day (kcal).
protein_g requirednumberProtein consumed that day, in grams.
carbs_g requirednumberCarbohydrates consumed that day, in grams.
fat_g requirednumberFat consumed that day, in grams.
fiber_g requirednumberFiber consumed that day, in grams.
sources_count requiredintegerThe entries logged that day. Deleted ones excluded.
updated_at requireddate-timeThe latest change of the day or its entries, a deletion included.
deleted_atdate-time | nullPresent when include_deleted is true.

Errors

StatusCodeWhen
400VALIDATIONInvalid parameters or body.billed
401UNAUTHORIZEDKey missing, unknown or revoked.not billed
402CREDITS_EXHAUSTEDNo credits left this month and no reserve.not billed
403SCOPE_MISSINGThe key doesn't have the required scope.not billed
403PLAN_NOT_ELIGIBLEYour plan doesn't include the API.not billed
429RATE_LIMITEDToo many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed

GET /meal-plans

Meal plans of the coach, templates included (student_id null). The content of a plan comes from the mealplans.read operation. A status the scheduler changes does not move updated_at. A deleted plan keeps the fields the coach wrote.

  • Scope nutrition:read
  • 1 credit
  • Read
  • Stable

Parameters

NameTypeDescription
limitqueryinteger1–200, default 50
cursorquerystringOpaque cursor: next_cursor of the previous page.
sincequerydate-timeISO 8601. Returns the objects with updated_at >= since.
include_deletedquerybooleandefault false
student_idqueryinteger≥ 1
statusquerystringone of draft, in_progress, scheduled, finished, template, cloning, clone_failedOnly this status, for example template.
curl "https://api.fitdistance.io/api/partner/v1/meal-plans?limit=50" \
  -H "Authorization: Bearer fd_live_xxxxxxxx"
200 · a page of MealPlan
{
  "data": [
    {
      "id": "7c1d1e2a-9b3f-4c5d-8e6f-1a2b3c4d5e6f",
      "coach_id": 4821,
      "student_id": 4821,
      "name": "string",
      "status": "draft",
      "weeks_duration": 8,
      "is_day_flag": true,
      "view_macros": true,
      "start_at": "2026-10-24T09:12:00Z",
      "end_at": "2026-10-24T09:12:00Z",
      "description": "string",
      "note": "string",
      "updated_at": "2026-10-24T09:12:00Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
403 · SCOPE_MISSING
{
  "error": {
    "name": "PARTNER_API",
    "message": "SCOPE_MISSING"
  }
}

200 · a page of MealPlan

NameTypeDescription
id requiredstring
coach_id requiredinteger
student_id requiredinteger | nullNull for a template.
name requiredstring
status requiredstringone of draft, in_progress, scheduled, finished, template, cloning, clone_failedA template has the status template.
weeks_duration requiredinteger
is_day_flag requiredbooleanThe plan is a single day, not a week.
view_macros requiredbooleanThe student sees the macros of the plan.
start_at requireddate-time | null
end_at requireddate-time | null
description requiredstring | null
note requiredstring | null
updated_at requireddate-timeThe latest change of the plan, its deletion included. A status change made by the scheduler does not move it.
deleted_atdate-time | nullPresent when include_deleted is true.

Errors

StatusCodeWhen
400VALIDATIONInvalid parameters or body.billed
401UNAUTHORIZEDKey missing, unknown or revoked.not billed
402CREDITS_EXHAUSTEDNo credits left this month and no reserve.not billed
403SCOPE_MISSINGThe key doesn't have the required scope.not billed
403PLAN_NOT_ELIGIBLEYour plan doesn't include the API.not billed
429RATE_LIMITEDToo many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed