SuperAPIAI Directory

fitatu_library

github.com · Other AI tools

fitatu_library is an unofficial Python API client for Fitatu (a calorie counter app), designed specifically for AI agents and automation scripts. It supports reading and writing food diary, activity, body measurement, and water data, reading and setting goals, and reading summaries and the food catalog. FitatuTools wraps the diary functionality as 47 tools callable by language models, providing JSON Schema inputs and read-only/destructive/idempotent annotations. The call() method never throws exceptions; instead, it returns a dictionary containing ok and either data or error. The project also provides a fitatu-mcp server that offers the same tools via stdio or HTTP to MCP hosts such as Claude Code and Claude Desktop. It requires Python 3.11 or later, and the only dependency is requests. This project is unofficial and is not affiliated with Fitatu Sp. z o.o.; the API was obtained through reverse engineering and may change at any time, automated access may violate Fitatu's terms of service, and you should use only your own account and at your own risk.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

fitatu_library is an unofficial Python client for the Fitatu API, Fitatu being a calorie counter app. The project is intended to be driven by AI agents and scripts for automated management of health and dietary data in Fitatu.

Purpose

The library is mainly used for programmatic access to Fitatu account data, including reading and writing food diary, activity records, body measurements, and water data, reading and setting nutritional goals, and reading daily summaries and the food catalog. It is particularly suitable for building AI agents that let language models call tools to manage a user's diet and health records.

Key capabilities

  • Data read/write: Supports reading and writing food diary, activity, body measurements, and water data, reading and setting goals, and reading summaries and the food catalog.
  • FitatuTools: Turns the diary functionality into 47 tools callable by language models, each with JSON Schema inputs and read-only/destructive/idempotent annotations. The call() method never throws exceptions and returns results in the format {"ok": true, "data": ...} or {"ok": false, "error": {...}}, making errors easy for models to understand.
  • fitatu-mcp server: Provides the same tools via stdio to Claude Code, Claude Desktop, and other MCP hosts, including SYSTEM_PROMPT as instructions and three Polish slash commands (podsumowanie_dnia, przeglad_tygodnia, zaloguj_posilek). It also supports --http mode to serve n8n, other computers, or Docker via a token.
  • Demo mode: fitatu-mcp --demo or FitatuTools.demo() provides an in-memory mock diary without an account.
  • CLI tool fitatu-api: Provides commands such as status, doctor, logout, call, and export for managing sessions, checking settings, calling tools, and exporting the diary.
  • Session management: Follows python-garminconnect's session handling approach: log in once and keep a session file, and the client automatically refreshes the token.Supports use in containers and cron via the FITATU_SESSION_JSON environment variable.
  • Free and Premium account support: Most features work on accounts without Fitatu Premium, but some features (such as daily nutrition summaries for protein, fat, and carbohydrates, popular products, and diary export) require Premium, otherwise a 403 is returned. The tool checks the account's accessControl flags and returns a forbidden error.

Usage

  • Installation: Requires Python 3.11 or later; the only dependency is requests (tzdata is also required on Windows). Install via pip, or clone the repository and run pip install -e ".[dev]" for development.
  • Login: Use the fitatu-api login command to log in and write the session file. For passwordless accounts registered with Apple or Facebook, copy the session from the web app via fitatu-api import-session.
  • Calling tools: Run a single tool via the fitatu-api call command, or call it in Python via FitatuTools.call(). By default only read-only tools run; --allow-writes is required to allow writes.
  • MCP integration: Run fitatu-mcp to serve MCP hosts over stdio, or use --http mode to serve over HTTP. You can also run uvx --from "fitatu-api[mcp]" fitatu-mcp to run without installation.
  • Export: fitatu-api export can export the diary as csv, xls, pdf, or txt, with file permissions 0600.

Use cases

  • Build AI agents to automatically record and manage diet, exercise, weight, and water intake data.
  • Integrate Fitatu features into AI assistants such as Claude Desktop and Claude Code via the MCP protocol.
  • Automation scripts to periodically sync or analyze Fitatu data.
  • Test tool functionality in demo mode without an account.

Limitations

  • This project is unofficialand is not affiliated with Fitatu Sp. z o.o.; the API is reverse-engineered and may change at any time.
  • Automated access may violate Fitatu's terms of service; use only with your own account and at your own risk.
  • The MIT license covers only the code, not the Fitatu service, API, or data.
  • Some features require a Fitatu Premium account, otherwise a 403 is returned.
  • The session file contains live tokens and should be treated like a password.
  • Write tools require a user-confirmation loop; the relevant guidelines are in docs/AGENTS.md.
  • The FitatuLibrary facade is deprecated and will be removed in version 1.0; using FitatuTools or the client is recommended.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools