Skip to Content
FFitDatadraft
Examples

Synthetic Examples

Real, test-verified synthetic FitData documents and standalone entities read directly from the repository.

Every example below is loaded directly from examples/ in the monorepo and validated continuously by the Vitest conformance suite. Open any of them in the Live Validator to edit and inspect validation output interactively.

Training document (examples/training.json)

A closed FitData document containing a step-based strength training.routine, an indoor cycling timeline training.routine with ramp targets and cues, a performed training.workout, and a training.threshold:

examples/training.json
{  "format": "fitdata",  "version": "0.0.0-local",  "profiles": [    "fitdata:core",    "fitdata:training"  ],  "producer": {    "name": "fitdata-examples",    "version": "0.0.0-local"  },  "references": "closed",  "records": [    {      "id": "demo:strength-routine",      "version": "1",      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "training.routine",      "name": "A short strength session",      "sport": "fitdata:strength",      "scheduled": {        "kind": "date",        "date": "2026-11-01",        "timezone": "Europe/Madrid"      },      "structure": {        "kind": "steps",        "steps": [          {            "id": "row-left",            "exercise": {              "id": "custom:one_arm_row",              "name": "One-arm row"            },            "side": "left",            "targets": [              {                "metric": "fitdata:repetitions",                "target": {                  "kind": "range",                  "min": 8,                  "max": 10,                  "unit": "1"                }              }            ],            "load": {              "basis": "external_per_hand",              "amount": {                "value": 18,                "unit": "kg"              }            },            "restSeconds": 60          },          {            "id": "assisted-pull",            "exercise": {              "id": "custom:assisted_pull_up"            },            "targets": [              {                "metric": "fitdata:repetitions",                "target": {                  "kind": "exact",                  "value": 6,                  "unit": "1"                }              }            ],            "load": {              "basis": "assisted",              "amount": {                "value": 15,                "unit": "kg"              }            }          },          {            "id": "hold",            "exercise": {              "id": "custom:side_plank"            },            "targets": [              {                "metric": "fitdata:duration",                "target": {                  "kind": "exact",                  "value": 30,                  "unit": "s"                }              }            ]          }        ]      }    },    {      "id": "demo:workout",      "revision": 1,      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "training.workout",      "sport": "fitdata:strength",      "interval": {        "start": "2026-11-01T08:00:00+01:00",        "durationSeconds": 900      },      "routine": {        "id": "demo:strength-routine",        "version": "1"      },      "status": "partial",      "sessionRpe": 7,      "steps": [        {          "id": "actual-1",          "plannedStepId": "row-left",          "exercise": {            "id": "custom:one_arm_row"          },          "side": "left",          "result": {            "kind": "completed",            "metrics": [              {                "metric": "fitdata:repetitions",                "value": 9,                "unit": "1"              }            ],            "load": {              "basis": "external_per_hand",              "amount": {                "value": 18,                "unit": "kg"              }            },            "rpe": 8          }        },        {          "id": "actual-2",          "plannedStepId": "assisted-pull",          "exercise": {            "id": "custom:assisted_pull_up"          },          "result": {            "kind": "skipped",            "reason": "Equipment unavailable"          }        },        {          "id": "actual-3",          "plannedStepId": "hold",          "exercise": {            "id": "custom:side_plank"          },          "result": {            "kind": "partial",            "metrics": [              {                "metric": "fitdata:duration",                "value": 20,                "unit": "s"              }            ]          }        }      ]    },    {      "id": "demo:ftp",      "revision": 1,      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "training.threshold",      "basis": "fitdata:ftp",      "metric": "fitdata:power",      "quantity": {        "value": 240,        "unit": "W"      },      "effectiveAt": "2026-10-25T08:00:00Z",      "method": "tested"    },    {      "id": "demo:cycle-routine",      "version": "1",      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "training.routine",      "name": "Threshold reference example",      "sport": "fitdata:cycling",      "structure": {        "kind": "steps",        "steps": [          {            "id": "interval-1",            "exercise": {              "id": "custom:indoor_cycling"            },            "targets": [              {                "metric": "fitdata:power",                "target": {                  "kind": "relative",                  "fraction": 0.9,                  "basis": "fitdata:ftp",                  "threshold": {                    "id": "demo:ftp",                    "revision": 1                  }                }              },              {                "metric": "fitdata:heart_rate",                "target": {                  "kind": "range",                  "min": 120,                  "max": 150,                  "unit": "/min"                }              }            ]          }        ]      }    },    {      "id": "example:five-minute-climb",      "version": "1",      "kind": "training.routine",      "name": "Five-minute climb",      "sport": "fitdata:indoor_cycling",      "structure": {        "kind": "timeline",        "durationSeconds": 300,        "segments": [          {            "id": "climb",            "startSeconds": 0,            "endSeconds": 300,            "label": "Steady climb",            "targets": [              {                "metric": "fitdata:power",                "target": {                  "kind": "ramp",                  "basis": "fitdata:ftp",                  "unit": "%",                  "start": 70,                  "end": 85,                  "interpolation": "linear"                }              },              {                "metric": "fitdata:cadence",                "target": {                  "kind": "range",                  "unit": "/min",                  "min": 75,                  "max": 85                }              }            ]          }        ],        "cues": [          {            "atSeconds": 0,            "posture": "seated",            "text": "Start seated."          },          {            "atSeconds": 180,            "posture": "standing",            "text": "Stand for the final two minutes."          }        ]      }    }  ]}

Standalone nutrition intake (examples/domains/nutrition/food-intake.json)

A nutrition.intake record embedding an immutable yogurt nutrition.food snapshot, recording 1.5 small pots (resolved to 187.5 g, 112.5 kcal, 18.75 g protein):

examples/domains/nutrition/food-intake.json
{  "kind": "nutrition.intake",  "schemaVersion": "0.0.0-local",  "revision": 1,  "subject": "example:person",  "time": {    "kind": "instant",    "at": "2026-11-01T08:30:00+01:00"  },  "recordedAt": "2026-11-01T08:35:00+01:00",  "source": {    "system": "example:diary",    "id": "breakfast-1"  },  "id": "example:intake-yogurt",  "intake": {    "kind": "food",    "snapshot": {      "kind": "nutrition.food",      "schemaVersion": "0.0.0-local",      "id": "example:yogurt",      "version": "1",      "names": [        {          "language": "en",          "text": "Example plain yogurt"        }      ],      "foodType": "branded",      "brand": "Example",      "identifiers": [        {          "system": "example:barcode",          "code": "synthetic-001"        }      ],      "sources": [        {          "system": "example:catalogue",          "id": "yogurt-1",          "version": "1"        }      ],      "servings": [        {          "id": "small-pot",          "names": [            {              "language": "en",              "text": "Small pot"            }          ],          "amount": 1,          "compositionIds": [            "as-sold"          ],          "equivalent": {            "kind": "mass",            "amount": 125,            "unit": "g"          }        },        {          "id": "large-pot",          "names": [            {              "language": "en",              "text": "Large pot"            }          ],          "amount": 1,          "compositionIds": [            "as-sold"          ],          "equivalent": {            "kind": "mass",            "amount": 200,            "unit": "g"          }        },        {          "id": "spoonful",          "names": [            {              "language": "en",              "text": "Spoonful"            }          ],          "amount": 2,          "compositionIds": [            "as-sold"          ],          "equivalent": {            "kind": "mass",            "amount": 30,            "unit": "g"          }        }      ],      "compositions": [        {          "id": "as-sold",          "state": "as_sold",          "basis": {            "kind": "mass",            "amount": 100,            "unit": "g"          },          "nutrients": [            {              "nutrient": {                "id": "example:energy",                "version": "1"              },              "value": {                "kind": "quantity",                "comparator": "=",                "value": "60",                "unit": "kcal"              },              "method": "label"            },            {              "nutrient": {                "id": "example:protein",                "version": "1"              },              "value": {                "kind": "quantity",                "comparator": "=",                "value": "10",                "unit": "g"              },              "method": "label"            },            {              "nutrient": {                "id": "example:calcium",                "version": "1"              },              "value": {                "kind": "quantity",                "comparator": "=",                "value": "120",                "unit": "mg"              },              "method": "label"            },            {              "nutrient": {                "id": "example:salt",                "version": "1"              },              "value": {                "kind": "quantity",                "comparator": "<",                "value": "0.1",                "unit": "g"              },              "method": "label"            },            {              "nutrient": {                "id": "example:fibre",                "version": "1"              },              "value": {                "kind": "absent",                "reason": "fitdata:not_reported"              },              "method": "label"            }          ]        }      ]    },    "compositionId": "as-sold",    "consumed": {      "kind": "serving",      "amount": 1.5,      "servingId": "small-pot"    },    "nutrition": {      "kind": "calculated",      "method": "fitdata:food_scaling@1",      "resolvedAmount": {        "kind": "mass",        "amount": 187.5,        "unit": "g"      },      "totals": [        {          "nutrient": {            "id": "example:energy",            "version": "1"          },          "value": {            "kind": "quantity",            "comparator": "=",            "value": 112.5,            "unit": "kcal"          },          "method": "calculated"        },        {          "nutrient": {            "id": "example:protein",            "version": "1"          },          "value": {            "kind": "quantity",            "comparator": "=",            "value": 18.75,            "unit": "g"          },          "method": "calculated"        },        {          "nutrient": {            "id": "example:calcium",            "version": "1"          },          "value": {            "kind": "quantity",            "comparator": "=",            "value": 225,            "unit": "mg"          },          "method": "calculated"        },        {          "nutrient": {            "id": "example:salt",            "version": "1"          },          "value": {            "kind": "quantity",            "comparator": "<",            "value": 0.1875,            "unit": "g"          },          "method": "calculated"        },        {          "nutrient": {            "id": "example:fibre",            "version": "1"          },          "value": {            "kind": "absent",            "reason": "fitdata:not_reported"          },          "method": "label"        }      ]    }  },  "capture": {    "method": "fitdata:manual",    "evidence": [],    "review": "confirmed"  }}

Standalone lab glucose result (examples/domains/lab/glucose-result.json)

A lab.result referencing the canonical LOINC glucose test (fitdata:glucose_serum_plasma_mass) with a result-owned laboratory reference range:

examples/domains/lab/glucose-result.json
{  "kind": "lab.result",  "schemaVersion": "0.0.0-local",  "id": "example:glucose-result",  "revision": 1,  "subject": "example:person",  "source": {    "system": "example:laboratory",    "id": "glucose-report-1",    "version": "1"  },  "test": {    "kind": "identified",    "definition": {      "id": "fitdata:glucose_serum_plasma_mass",      "version": "1"    }  },  "collected": {    "kind": "date",    "date": "2026-11-01"  },  "status": "final",  "review": "unreviewed",  "raw": {    "label": "Glucose",    "value": "92",    "unit": "mg/dL",    "reference": "70–105 (invented example laboratory range)"  },  "value": {    "kind": "quantity",    "comparator": "=",    "value": "92",    "unit": "mg/dL"  },  "referenceRanges": [    {      "kind": "numeric",      "purpose": "reference",      "sourceKind": "laboratory",      "source": {        "system": "example:laboratory",        "id": "glucose-report-1",        "version": "1"      },      "low": "70",      "high": "105",      "unit": "mg/dL",      "applicability": "Invented for format demonstration; not a default or medical recommendation."    }  ]}

Revision history and tombstones (examples/history.json)

Demonstrates multiple revisions of a logical record and logical deletion via core.tombstone:

examples/history.json
{  "format": "fitdata",  "version": "0.0.0-local",  "producer": {    "name": "fitdata-examples",    "version": "0.0.0-local"  },  "references": "closed",  "records": [    {      "kind": "core.tombstone",      "id": "demo:mass",      "revision": 3,      "recordedAt": "2026-11-01T10:00:00Z"    },    {      "id": "demo:mass",      "revision": 2,      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "core.measurement",      "metric": "fitdata:body_mass",      "time": {        "kind": "instant",        "at": "2026-11-01T07:00:00Z"      },      "value": {        "kind": "quantity",        "value": "72.4500",        "unit": "kg"      },      "extensions": {        "vendor:future": {          "quality": "unreviewed",          "precision": 4        }      }    },    {      "id": "demo:mass",      "revision": 1,      "subject": "demo:athlete",      "recordedAt": "2026-11-01T10:00:00Z",      "provenance": {        "kind": "manual",        "source": {          "provider": "example"        }      },      "kind": "core.measurement",      "metric": "fitdata:body_mass",      "time": {        "kind": "instant",        "at": "2026-11-01T07:00:00Z"      },      "value": {        "kind": "quantity",        "value": "72.4500",        "unit": "kg"      },      "extensions": {        "vendor:future": {          "quality": "unreviewed",          "precision": 4        }      }    }  ]}

On this page