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
| Name | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 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
| Name | Type | Description |
|---|---|---|
id required | string | |
student_id required | integer | |
date required | date-time | null | When the student ate the meal. |
type required | stringone of breakfast, lunch, dinner, snack | |
content required | string | null | Written by the student, served as is: treat it as untrusted input. Null when deleted. |
note required | string | null | Written by the student, served as is: treat it as untrusted input. Null when deleted. |
photos_count required | integer | Photos of the meal, never their URL. Deleted ones excluded. 0 when deleted. |
comments_count required | integer | Comments on the meal. Deleted ones excluded. 0 when deleted. |
updated_at required | date-time | The latest change of the meal, its photos or its comments, a deletion included. |
deleted_at | date-time | null | Present when include_deleted is true. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION | Invalid parameters or body.billed |
401 | UNAUTHORIZED | Key missing, unknown or revoked.not billed |
402 | CREDITS_EXHAUSTED | No credits left this month and no reserve.not billed |
403 | SCOPE_MISSING | The key doesn't have the required scope.not billed |
403 | PLAN_NOT_ELIGIBLE | Your plan doesn't include the API.not billed |
429 | RATE_LIMITED | Too 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
| Name | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 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
| Name | Type | Description |
|---|---|---|
id required | integer | |
student_id required | integer | |
date required | date | The day the totals count for. |
calories required | number | Calories consumed that day (kcal). |
protein_g required | number | Protein consumed that day, in grams. |
carbs_g required | number | Carbohydrates consumed that day, in grams. |
fat_g required | number | Fat consumed that day, in grams. |
fiber_g required | number | Fiber consumed that day, in grams. |
sources_count required | integer | The entries logged that day. Deleted ones excluded. |
updated_at required | date-time | The latest change of the day or its entries, a deletion included. |
deleted_at | date-time | null | Present when include_deleted is true. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION | Invalid parameters or body.billed |
401 | UNAUTHORIZED | Key missing, unknown or revoked.not billed |
402 | CREDITS_EXHAUSTED | No credits left this month and no reserve.not billed |
403 | SCOPE_MISSING | The key doesn't have the required scope.not billed |
403 | PLAN_NOT_ELIGIBLE | Your plan doesn't include the API.not billed |
429 | RATE_LIMITED | Too 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
| Name | Type | Description |
|---|---|---|
limitquery | integer1–200, default 50 | |
cursorquery | string | Opaque cursor: next_cursor of the previous page. |
sincequery | date-time | ISO 8601. Returns the objects with updated_at >= since. |
include_deletedquery | booleandefault false | |
student_idquery | integer≥ 1 | |
statusquery | stringone of draft, in_progress, scheduled, finished, template, cloning, clone_failed | Only 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
| Name | Type | Description |
|---|---|---|
id required | string | |
coach_id required | integer | |
student_id required | integer | null | Null for a template. |
name required | string | |
status required | stringone of draft, in_progress, scheduled, finished, template, cloning, clone_failed | A template has the status template. |
weeks_duration required | integer | |
is_day_flag required | boolean | The plan is a single day, not a week. |
view_macros required | boolean | The student sees the macros of the plan. |
start_at required | date-time | null | |
end_at required | date-time | null | |
description required | string | null | |
note required | string | null | |
updated_at required | date-time | The latest change of the plan, its deletion included. A status change made by the scheduler does not move it. |
deleted_at | date-time | null | Present when include_deleted is true. |
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION | Invalid parameters or body.billed |
401 | UNAUTHORIZED | Key missing, unknown or revoked.not billed |
402 | CREDITS_EXHAUSTED | No credits left this month and no reserve.not billed |
403 | SCOPE_MISSING | The key doesn't have the required scope.not billed |
403 | PLAN_NOT_ELIGIBLE | Your plan doesn't include the API.not billed |
429 | RATE_LIMITED | Too many calls: 10 per second, 300 per minute, 60 writes and 20 deletes per minute.not billed |