Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Kcal Calc

13green1313green1314 downloads

Annotates ingredient lines with kcal values from USDA FoodData Central.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates3

Kcal Calc is an Obsidian plugin that scans the active Markdown note for ingredient lines, looks up matching foods through USDA FoodData Central, appends kcal values, and adds an underlined total.

For the plugin to work, you will need to add your API key in the plugin settings, you can get your API key for free here https://fdc.nal.usda.gov/api-key-signup

image

Network use and privacy

Kcal Calc uses the USDA FoodData Central API at https://api.nal.usda.gov/fdc/v1/foods/search to look up ingredient nutrition data. When you run the annotation command, the plugin sends each ingredient search query and your USDA API key to USDA FoodData Central. This network access is required for nutrition lookup.

Kcal Calc does not include telemetry, advertising, automatic update mechanisms, or access files outside your Obsidian vault.

Ingredient format

Use one ingredient per line:

dark chocolate - 200g
banana - 120g

The default delimiter is -. You can change it in the plugin settings, for example to : if you prefer:

dark chocolate : 200g
banana : 120g

Bullet lines are also supported:

- dark chocolate - 200g
- banana - 120g

After running the command and accepting the preview, the note is rewritten like this:

dark chocolate - 200g (1092 kcal, P 15.6g, C 91.6g, F 85.6g)
banana - 120g (107 kcal, P 1.3g, C 27.4g, F 0.4g)

<u>Total kcal: 1199 kcal, P 16.9g, C 119g, F 86g</u>

The command is idempotent: running it again updates the kcal annotations and replaces the previous total line.

Meal sections

If your note uses Markdown headings, Kcal Calc can add section totals before the next heading:

## Breakfast
banana - 120g
Greek yogurt - 250g

## Dinner
rice - 200g
chicken breast - 180g

This produces underlined Section kcal totals for each heading and one final Total kcal line for the whole note.

Match preview and confidence

Before applying changes, the plugin shows a preview of each typed ingredient, the USDA food it matched, its kcal/macros, and a confidence value.

If a match needs review, the note line gets a marker like this:

dark choclate - 200g (1092 kcal, P 15.6g, C 91.6g, F 85.6g) [? matched: Chocolate, dark, 70-85% cacao solids]

This helps catch misspellings and surprising USDA matches without blocking the workflow.

Preferred foods

In settings, add preferred food aliases one per line:

whey = Whey protein powder
dark choc = Chocolate, dark, 70-85% cacao solids
skyr = Yogurt, Greek, plain, nonfat

When the note contains whey - 30g, the plugin searches USDA for Whey protein powder while preserving the original note text.

You can also use JSON if you prefer:

{
    "whey": "Whey protein powder",
    "dark choc": "Chocolate, dark, 70-85% cacao solids"
}

Settings

  • Ingredient delimiter: defaults to -.
  • Include macros: adds protein, carbs, and fat when USDA provides them.
  • Add section totals: totals each Markdown heading section.
  • Show match preview: asks before rewriting the note.
  • Mark low-confidence matches: appends review markers for suspicious matches.
  • Preferred foods: alias dictionary for consistent USDA searches.

Setup

  1. Install dependencies:
npm install
  1. Build the plugin:
npm run build
  1. Copy these files into your vault at .obsidian/plugins/kcal-calc/:
main.js
manifest.json
styles.css
  1. Enable the plugin in Obsidian and add your USDA FoodData Central API key in the plugin settings.

Commands

  • Annotate ingredient kcal in active note

The ribbon calculator icon runs the same action.

License

MIT

HealthExcellent
ReviewPassed
About
Scan the active note for ingredient lines and look up matching foods in USDA FoodData Central to fetch kcal and macronutrient values. Append per-item kcal and macros, add underlined section and total kcal lines, and show a match preview with confidence before applying changes.
AnnotationIntegrationsData
Details
Current version
0.1.2
Last updated
Yesterday
Created
Yesterday
Updates
3 releases
Downloads
14
Compatible with
Obsidian 1.5.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
13green1313green1313green13
GitHub13green13
  1. Community
  2. Plugins
  3. Annotation
  4. Kcal Calc

Related plugins

Raindrop Highlights

Sync your Raindrop.io highlights.

BRAT

Easily install a beta version of a plugin for testing.

Fast Note Sync

Real-time sync of your vaults across server, mobile, and web; shareable with anyone; supports REST and MCP integrations to build your personal AI knowledge base.

Local REST API with MCP

Unlock your automation needs by interacting with your notes over a secure REST API.

Maps

Adds a map layout to bases so you can display notes as an interactive map view.

Admonition

Admonition block-styled content.

Tracker

Track occurrences and numbers in your notes.

Zotero Integration

Insert and import citations, bibliographies, notes, and PDF annotations from Zotero.

Agent Client

Chat with Claude Code, Codex, Gemini CLI, and more via the Agent Client Protocol — right from your vault.

Readwise Official

Sync highlights from Readwise to your vault.