Import and export file format
Diet Tracker exports and imports plain JSON, in two kinds of file. Export Foods writes a foods file (your food list), read by Import Foods. Export History writes a history file (days, logged entries, target changes and your profile), read by Import History. You can edit these files, move them between accounts, or build one yourself from another app's data.
The file
| Field | Type | Meaning |
|---|---|---|
format | string | Required. Always "diet-tracker". |
version | number | Required. Currently 1. |
exportedAt | string | Optional. When it was exported (ISO 8601); ignored on import. |
foods | list | Your food list. See Foods. |
days | list | Weigh-ins and notes, one per date. See Days. |
entries | list | What you ate. See Entries. |
targets | list | Plan, target and goal changes. See Targets. |
profile | object | Optional sex, birth date and height. See Profile. |
Dates are YYYY-MM-DD. Macros are in grams, calories in kcal, weight in pounds, body
fat in percent. A missing number counts as 0 unless the table says it may be null.
Items with a missing name or a malformed date are skipped.
Foods
Each food is one serving's worth of nutrition. Foods are matched by name, ignoring case.
| Field | Type | Meaning |
|---|---|---|
name | string | Required. Unique in your list, ignoring case. |
serving | string | What one serving is, such as "1 oz" or "1 cup (245g)". |
netCarbs | number | Net carbs per serving (carbs minus fiber and sugar alcohols). |
protein | number | Protein per serving. |
calories | number | Calories per serving. |
notes | string | Optional free text. |
fdcId | number or null | The USDA FoodData Central ID, if the food came from USDA. |
favorite | boolean | Starred for one-tap quick add on Today. |
archived | boolean | Hidden from Today, kept for past entries. |
{
"format": "diet-tracker",
"version": 1,
"exportedAt": "2026-10-30T21:00:00.000Z",
"foods": [
{
"name": "String cheese",
"serving": "1 stick (28g)",
"netCarbs": 1,
"protein": 6,
"calories": 80,
"notes": "",
"fdcId": null,
"favorite": true,
"archived": false
}
]
} Days
| Field | Type | Meaning |
|---|---|---|
date | string | Required. The day, YYYY-MM-DD. |
weight | number or null | Morning weigh-in, in pounds. |
bodyFat | number or null | Body fat, in percent. |
waist | number or null | Waist, in inches. |
notes | string | The day's notes. |
Entries
Each entry is something you ate, with its totals for the amount eaten (not per serving), so it keeps its values even if the food is later edited or missing.
| Field | Type | Meaning |
|---|---|---|
date | string | Required. The day it was eaten. |
meal | string | breakfast, lunch, dinner or snack (anything else becomes snack). day marks a whole-day total imported from an older log. |
name | string | Required. The name shown in the diary. |
food | string or null | Name of the food in your list this came from, which links it for editing the portion. null for a custom entry, or if there's no such food. |
servings | number | How many servings of that food. Defaults to 1. |
netCarbs | number | Net carbs eaten. |
protein | number | Protein eaten. |
calories | number | Calories eaten. |
source | string | app for entries logged in Diet Tracker (editable), import for read-only totals from an older log. |
Targets
Each change applies from its start date until the next change, and carries the plan and goals
as well as the daily limits. Files from before plans existed (without plan or goal
fields) import as Keto with no goals.
| Field | Type | Meaning |
|---|---|---|
startDate | string | Required. First day these targets apply. |
netCarbs | number | Daily net carbs maximum. |
protein | number | Daily protein minimum. |
calories | number | Daily calories maximum. |
plan | string | keto, or South Beach sb1, sb2 or sb3 (phases 1–3). Defaults to keto. |
weightGoal | number or null | Goal weight, lb. |
bodyFatGoal | number or null | Goal body fat, %. |
lossRate | number or null | Target loss in lb per week; 0 means maintain. |
Profile
Optional, and imported only into fields your account hasn't filled in; an import never overwrites your profile.
| Field | Type | Meaning |
|---|---|---|
sex | string or null | male or female. |
birthDate | string or null | YYYY-MM-DD. |
height | number or null | Inches. |
{
"format": "diet-tracker",
"version": 1,
"exportedAt": "2026-10-30T21:00:00.000Z",
"days": [
{ "date": "2026-10-30", "weight": 190.4, "bodyFat": 22.5, "waist": 38, "notes": "Long hike" }
],
"entries": [
{
"date": "2026-10-30",
"meal": "lunch",
"food": "Brisket",
"name": "Brisket",
"servings": 7,
"netCarbs": 0,
"protein": 49,
"calories": 420,
"source": "app"
}
],
"targets": [
{
"startDate": "2026-10-01",
"plan": "sb1",
"netCarbs": 50,
"protein": 140,
"calories": 1750,
"weightGoal": 185,
"bodyFatGoal": 20,
"lossRate": 1
}
],
"profile": { "sex": "male", "birthDate": "1965-04-12", "height": 70 }
} When a file overlaps your data
Before changing anything, an import checks for foods with the same name, target changes with the same start date, and days that already have entries, a weigh-in or notes. If there are any, it lists them (days as date ranges) and asks:
- Keep mine: those foods, target changes and days stay exactly as they are; everything else in the file is added.
- Replace with file: the file's version wins. Each overlapping day gets exactly the file's entries, weigh-in and notes.
Importing the same file twice never creates duplicates.