Coming soon

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

  1. 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.
  2. Authenticate. Send the token as a Bearer token in the Authorization header of every GET request to https://api.govital.app/v1.
  3. Page through results. List endpoints return data, has_more and next_cursor.
Your first request
curl "https://api.govital.app/v1/diary/days?from=2026-10-01&to=2026-10-07" \
  -H "Authorization: Bearer vital_pat_YOUR_TOKEN"
The same request in Python
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:

A page
{ "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.

LimitValue
Requests120 a minute for each token
Page sizelimit from 1 to 500, default 100
Page size on /v1/diary/dayslimit 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.

An error
{ "error": { "code": "token_revoked", "message": "This access token was revoked. Create a new one in Vital, Settings, Connected apps." } }
StatusCodeMeaning
400invalid_parameterA parameter is malformed. The message names it.
400invalid_cursorThe cursor was not issued by this endpoint.
401invalid_tokenNo token, a malformed token, or one Vital does not know.
401token_revokedThe token was revoked in the app.
401token_expiredThe token passed its expiry date.
404not_foundNo such endpoint or version.
405method_not_allowedNot a GET.
410cursor_expiredA deletions position older than 90 days. Pull the diary again from the start.
429rate_limitedOver the limit. Wait the number of seconds in the Retry-After header.
500internal_errorA fault on our side. Try again.

5How to read the data

Every endpoint follows these conventions.

  • local_date is 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's local_date.
  • logged_at is 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. timezone is the zone the phone was in at that instant. It is null for anything logged before November 16, 2026, when phones began reporting it. eaten_at is reserved and null: 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 just value, its unit sits beside it.
  • null means unknown, not zero. A nutrient the food's source never reported is null. Totals skip nulls. An item's nutrition is 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_basisWhat you getTrust
noneNo list. A plain or packaged food: Vital stores no ingredients for it.Not applicable
photo_estimateThe foods an AI saw in a meal photo, each with a confidence from 0 to 1.An estimate
recipe_version_stampedThe ingredients of the exact recipe version that was logged.High
recipe_version_inferred_by_dateNo version was recorded, so this is the version that was current when the entry was logged.Good
recipe_version_earliest_knownLogged before the recipe had any history, so this is the oldest version on record.Fair
recipe_unavailableNo 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.

EndpointReturnsParametersKind
GET /v1/meDisplay name, goals, units, timezone and householdsNoneOne object
GET /v1/diary/daysDays, each with its meals, their items and the items' ingredientsfrom to ingredients limit cursorPages by day
GET /v1/diary/entriesFood diary items, flat, with ingredientsfrom to updated_after ingredients limit cursorSync
GET /v1/exercise-entriesLogged exercise and daily step caloriesfrom to updated_after limit cursorSync
GET /v1/measurementsSteps, active energy, weigh-ins, sleep and resting heart rate from Apple Healthkind from to updated_after limit cursorSync
GET /v1/deletionsIds of deleted diary and exercise entriessince limit cursorSync
GET /v1/workoutsStrength sessions with their setsfrom to limit cursorSnapshot
GET /v1/cardio-sessionsRuns, walks, rides and other cardiofrom to series limit cursorSnapshot
GET /v1/recipesRecipes you own, with ingredients, matched foods and sideslimit cursorSnapshot
GET /v1/saved-mealsSaved meals with their itemslimit cursorSnapshot
GET /v1/meal-plan/entriesPlanned items by dayfrom to limit cursorSnapshot
GET /v1/meal-plan/templatesWeekly templates with their entrieslimit cursorSnapshot
GET /v1/habitsHabitslimit cursorSnapshot
GET /v1/habit-logsEach habit's record for each dayfrom to limit cursorSnapshot
GET /v1/custom-foodsFoods you created or correctedlimit cursorSnapshot
GET /v1/pantry/itemsThe household pantry with its stocklimit cursorSnapshot
GET /v1/fitness/planSaved workouts, weekly set targets and weekly activitiesNoneOne 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.

GET /v1/diary/days?from=2026-10-03&to=2026-10-03
{
  "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.

  1. First run. Call /v1/diary/entries with no cursor and follow next_cursor until has_more is false. Store the last next_cursor, since sync endpoints return one even on the last page. Do the same for /v1/exercise-entries, /v1/measurements and /v1/deletions.
  2. Every later run. Call each with its stored cursor. Save what comes back by id, remove what /v1/deletions lists, and store the new cursors. When nothing changed you get an empty list and the same cursor.
  3. 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_photo says 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.

Coming soon to theApp Store