← All Docs

API

Programmatic access to your meal tracking data via the REST API.

Public API

mealtally offers a REST API for programmatic access to your meal tracking data. Use it to build integrations, export data to other apps, or create custom dashboards.

The API supports:

  • Reading meals — list all meals or fetch a single meal with full nutrition data and individual food items.
  • Submitting meals — send free-text meal descriptions for AI-powered nutrition parsing.
  • Nutrition summaries — retrieve daily or weekly calorie and macro aggregates.
  • Weight tracking — retrieve logged weight entries over 7 days, 30 days, 90 days, 1 year, or all time, and log new entries.
  • Agent provisioning — create and manage users, profiles, subscriptions, and billing flows with scoped agent keys.

Full interactive documentation with request/response schemas and examples is available at api.mealtally.com/docs.

API Quick Start

  1. Generate an API key — Go to Settings → API Keys on your mealtally dashboard and create a new key with the scopes you need.
  2. Make your first request — Pass the key as a Bearer token:
    curl -H "Authorization: Bearer tm_your_key" https://api.mealtally.com/api/v1/meals
  3. Explore the docs — Visit the interactive API reference for detailed schemas, parameters, and examples.
API keys are scoped to specific permissions: meals:read, meals:write, summary:read, weight:read, weight:write, users:create, users:read, users:manage, profile:read, profile:write, and billing:manage. Existing keys with summary:read can still read weight history. Only grant the scopes your integration needs.

MCP Server

The installable mealtally-mcp server exposes the full public API as Model Context Protocol tools for AI clients and local agents. It includes typed tools for every /api/v1 endpoint plus an advanced mealtally_api_request tool for documented /api/... paths.

  1. Install from GitHub
    npm install -g git+https://github.com/michael-burt/mealtally.git
  2. Run with your API key
    MEALTALLY_API_KEY=tm_your_key MEALTALLY_API_BASE_URL=https://api.mealtally.com mealtally-mcp
  3. Add it to an MCP client — use mealtally-mcp as the command and pass MEALTALLY_API_KEY in the server environment:
    { "mcpServers": { "mealtally": { "command": "mealtally-mcp", "env": { "MEALTALLY_API_KEY": "tm_your_key", "MEALTALLY_API_BASE_URL": "https://api.mealtally.com" } } } }

The most common tools are mealtally_log_meal, mealtally_list_meals, mealtally_get_summary, mealtally_log_weight, and mealtally_list_weight. Agent API keys can also use user provisioning and billing tools such as mealtally_create_user, mealtally_update_user_profile, and mealtally_create_user_billing_checkout.

For setup details, scopes, all tools, and troubleshooting, see the MCP server README.