The Vital API
Version 1 · Updated · OpenAPI file
The Vital API is a read-only JSON API for your own Vital data: food diary entries with their ingredients, recipes, workouts, habits, meal plans and Apple Health history. Each token reads only the account that created it, and the API is free on every account. Start with the quick start below, or download the OpenAPI spec to import into Postman or generate a client.
1Quick start
- Create a token. In Vital, open Settings, then Connected Apps, then New Access Token. Name it after the app it is for and choose whether it expires. Copy the token: it starts with
vital_pat_and is shown once. - Authenticate. Send the token as a Bearer token in the
Authorizationheader of every GET request tohttps://api.govital.app/v1. - Page through results. List endpoints return
data,has_moreandnext_cursor.
curl "https://api.govital.app/v1/diary/days?from=2026-10-01&to=2026-10-07" \
-H "Authorization: Bearer vital_pat_YOUR_TOKEN"import requests
BASE = "https://api.govital.app/v1"
headers = {"Authorization": "Bearer vital_pat_YOUR_TOKEN"}
days = requests.get(f"{BASE}/diary/days", headers=headers,
params={"from": "2026-10-01", "to": "2026-10-07"}).json()
for day in days["data"]:
print(day["local_date"], day["nutrition_total"]["calories_kcal"], "kcal")2Tokens
Personal access tokens are the only credential the API accepts. Treat one like a password: store it as a secret, keep it out of source control and screenshots, and give it only to an app you trust.
- Shown once. Vital stores only a hash of the token and cannot show it again. If you lose it, create a new one.
- Revoke at any time. In Settings, Connected Apps, tap the token and choose Revoke. It stops working on the next request.
- Expiry is your choice. Never, 30 days, 90 days or 1 year.
- Last used. The list shows when each token was last used, so an unfamiliar date is a reason to revoke.
- Ten at a time. An account can hold 10 live tokens. Deleting your account revokes all of them.
What a connected app does with your data is up to that app. See the privacy policy and the terms.
3Requests and paging
The API is read-only. It accepts GET and HEAD and returns 405 for any other method. No parameter selects a user: the token alone decides whose data you get.
List endpoints return a page at a time:
{ "data": [ ... ], "has_more": true, "next_cursor": "eyJrIjoi..." }To get the next page, send the same request again with cursor set to the next_cursor you were given. A cursor is opaque and only works on the endpoint that issued it.
| Limit | Value |
|---|---|
| Requests | 120 a minute for each token |
| Page size | limit from 1 to 500, default 100 |
Page size on /v1/diary/days | limit from 1 to 31 days, default 7 |
Dates are YYYY-MM-DD. Timestamps need a timezone, such as 2026-10-03T14:05:00Z. Responses are never cached.
4Errors
Every error has the same shape, with a stable code for your program and a message for a person.
{ "error": { "code": "token_revoked", "message": "This access token was revoked. Create a new one in Vital, Settings, Connected apps." } }| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_parameter | A parameter is malformed. The message names it. |
| 400 | invalid_cursor | The cursor was not issued by this endpoint. |
| 401 | invalid_token | No token, a malformed token, or one Vital does not know. |
| 401 | token_revoked | The token was revoked in the app. |
| 401 | token_expired | The token passed its expiry date. |
| 404 | not_found | No such endpoint or version. |
| 405 | method_not_allowed | Not a GET. |
| 410 | cursor_expired | A deletions position older than 90 days. Pull the diary again from the start. |
| 429 | rate_limited | Over the limit. Wait the number of seconds in the Retry-After header. |
| 500 | internal_error | A fault on our side. Try again. |
5How to read the data
Every endpoint follows these conventions.
local_dateis the phone's calendar day. It is the calendar day the entry was filed under on the phone. Group by it. A snack logged at 12:40 a.m. under yesterday has yesterday'slocal_date.logged_atis when the entry was written, not when the food was eaten. It is a UTC timestamp. People back-fill, so it is not always when the food was eaten.timezoneis the zone the phone was in at that instant. It isnullfor anything logged before November 16, 2026, when phones began reporting it.eaten_atis reserved andnull: Vital does not record a time eaten yet.- Units are in the field name.
calories_kcal,protein_g,sodium_mg,weight_kg,distance_m,duration_sec. Where a field is justvalue, itsunitsits beside it. nullmeans unknown, not zero. A nutrient the food's source never reported isnull. Totals skip nulls. An item'snutritionis the total for the whole serving, so never multiply it by the quantity again.
Vital has no stored meal. A meal is the items that share a local_date and a meal_type (breakfast, lunch, dinner or snacks), and the API gives each one a stable id such as 2026-10-03:dinner.
6Ingredients, and how far to trust them
Each diary item says where its ingredient list came from, in ingredients_basis, so you can decide how much weight to give it.
| ingredients_basis | What you get | Trust |
|---|---|---|
none | No list. A plain or packaged food: Vital stores no ingredients for it. | Not applicable |
photo_estimate | The foods an AI saw in a meal photo, each with a confidence from 0 to 1. | An estimate |
recipe_version_stamped | The ingredients of the exact recipe version that was logged. | High |
recipe_version_inferred_by_date | No version was recorded, so this is the version that was current when the entry was logged. | Good |
recipe_version_earliest_known | Logged before the recipe had any history, so this is the oldest version on record. | Fair |
recipe_unavailable | No list. The recipe was deleted before November 2026 and nothing of it was kept. | Not applicable |
For a recipe, recipe.fraction_eaten is the servings logged divided by the servings the recipe makes, and each ingredient's nutrition is already scaled to that share. counted: false means the line was never matched to a food and adds nothing to the numbers. weight_estimated: true means the gram weight is an AI estimate. A recipe deleted after November 2026 keeps its ingredient history for the people who logged it, marked recipe.deleted: true.
7Endpoints
All paths are under https://api.govital.app. Sync endpoints return a cursor you can resume from on the next run. Snapshot endpoints return the whole current set.
| Endpoint | Returns | Parameters | Kind |
|---|---|---|---|
GET /v1/me | Display name, goals, units, timezone and households | None | One object |
GET /v1/diary/days | Days, each with its meals, their items and the items' ingredients | from to ingredients limit cursor | Pages by day |
GET /v1/diary/entries | Food diary items, flat, with ingredients | from to updated_after ingredients limit cursor | Sync |
GET /v1/exercise-entries | Logged exercise and daily step calories | from to updated_after limit cursor | Sync |
GET /v1/measurements | Steps, active energy, weigh-ins, sleep and resting heart rate from Apple Health | kind from to updated_after limit cursor | Sync |
GET /v1/deletions | Ids of deleted diary and exercise entries | since limit cursor | Sync |
GET /v1/workouts | Strength sessions with their sets | from to limit cursor | Snapshot |
GET /v1/cardio-sessions | Runs, walks, rides and other cardio | from to series limit cursor | Snapshot |
GET /v1/recipes | Recipes you own, with ingredients, matched foods and sides | limit cursor | Snapshot |
GET /v1/saved-meals | Saved meals with their items | limit cursor | Snapshot |
GET /v1/meal-plan/entries | Planned items by day | from to limit cursor | Snapshot |
GET /v1/meal-plan/templates | Weekly templates with their entries | limit cursor | Snapshot |
GET /v1/habits | Habits | limit cursor | Snapshot |
GET /v1/habit-logs | Each habit's record for each day | from to limit cursor | Snapshot |
GET /v1/custom-foods | Foods you created or corrected | limit cursor | Snapshot |
GET /v1/pantry/items | The household pantry with its stock | limit cursor | Snapshot |
GET /v1/fitness/plan | Saved workouts, weekly set targets and weekly activities | None | One object |
kind on /v1/measurements is one of steps, active_energy, body_weight, sleep or resting_heart_rate. series=true on /v1/cardio-sessions adds the GPS route and heart-rate samples. ingredients=false skips the recipe lookup when you only need totals.
8Example: a day of meals
GET /v1/diary/days returns each day with its meals, their items and the ingredients of any recipe, in one call. The response below is shortened: every nutrition block has 23 fields, and four are shown.
{
"data": [
{
"local_date": "2026-10-03",
"nutrition_total": { "calories_kcal": 677, "protein_g": 58.7, "carbs_g": 41, "fat_g": 28.4 },
"meals": [
{
"id": "2026-10-03:dinner",
"local_date": "2026-10-03",
"meal_type": "dinner",
"eaten_at": null,
"timezone": "America/Denver",
"first_logged_at": "2026-10-04T02:31:55.102118+00:00",
"nutrition_total": { "calories_kcal": 495, "protein_g": 46.5, "carbs_g": 39, "fat_g": 15 },
"items": [
{
"id": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
"name": "Turkey Chili",
"serving": { "quantity": 1.5, "label": "1 serving", "unit": "serving", "unit_quantity": 1 },
"nutrition": { "calories_kcal": 495, "protein_g": 46.5, "carbs_g": 39, "fat_g": 15 },
"recipe": { "title": "Turkey Chili", "version_no": 3, "servings": 6, "fraction_eaten": 0.25, "deleted": false },
"ingredients_basis": "recipe_version_stamped",
"ingredients": [
{
"name": "Turkey, Ground, 93% Lean, Raw",
"recipe_line": { "name": "ground turkey", "quantity_text": "2 lb" },
"counted": true,
"weight_estimated": false,
"nutrition": { "calories_kcal": 340, "protein_g": 42.5, "carbs_g": 0, "fat_g": 18.75 }
}
]
}
]
}
]
}
],
"has_more": false,
"next_cursor": null
}9Keeping a copy in sync
If your app keeps its own copy of the data, pull everything once and then ask only for what changed.
- First run. Call
/v1/diary/entrieswith no cursor and follownext_cursoruntilhas_moreis false. Store the lastnext_cursor, since sync endpoints return one even on the last page. Do the same for/v1/exercise-entries,/v1/measurementsand/v1/deletions. - Every later run. Call each with its stored cursor. Save what comes back by
id, remove what/v1/deletionslists, and store the new cursors. When nothing changed you get an empty list and the same cursor. - If deletions answers 410. Your position is older than 90 days. Discard your diary and exercise copies and start again from the first run.
An edit arrives as the same id with a newer updated_at. For the snapshot endpoints, replace your copy with what you receive: anything missing has been deleted. Those sets are small, usually tens to a few hundred rows.
10What is not included
- Writing. There is no way to add, change or delete data through the API.
- Time eaten. The field exists and is empty until the app records it.
- The shopping list. It is worked out on the phone from the meal plan and is not stored as a list.
- Other household members' data. A token reads its owner's diary, workouts and habits. The pantry and household meal templates are shared by design and are included.
- Photos.
has_photosays an entry has one, but the image is not served. - Health categories beyond the five listed. Apple Health history is included only for people who connected Apple Health, and sleep and resting heart rate only if they allowed them.
11Versions and help
This is version 1, live since November 16, 2026. New fields can appear at any time, so ignore fields you do not recognize. Removing or renaming a field, or changing a unit, will only happen under a new version at /v2.
The OpenAPI spec lists every field of every endpoint and imports into Postman, Insomnia and most client generators. For questions or a problem with the API, write to [email protected].
Get Vital
Your calories, recipes and workouts, all in one place. Barcode scanning is free.