agentsclimarketplace

Openfoodfacts shared

Skill Alfredvc/openfoodfacts-cli/skills/openfoodfacts-shared

Single-binary Rust CLI for the Open Food Facts API, structured JSON output designed for AI agent consumption.

Install
npx -y skills add Alfredvc/openfoodfacts-cli --skill openfoodfacts-shared

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Runtime contract for the openfoodfacts CLI. Covers output format, error handling, field filtering, and invocation patterns. No authentication required. Use as foundation before any other openfoodfacts skill.

SKILL.md

2.0 KB, as published. Nobody here has run it

openfoodfacts-shared

Foundation skill for the openfoodfacts CLI. Read this before using any other openfoodfacts skill.

No Authentication Required

The Open Food Facts API is fully public. No API key, no login, no environment variables needed.

Invocation Pattern

Always use --json to ensure compact, parseable output:

openfoodfacts --json <command>

Use --fields to reduce output to only the fields you need (saves tokens):

openfoodfacts --json --fields product_name,brands,nutriscore_grade products get 3017624010701

Output Format

  • Success: JSON to stdout, exit code 0
  • Error: JSON to stderr ({"error": "message"}), exit code 1

Search commands without --all return a paginated envelope:

{"count": 4821, "page": 1, "page_count": 242, "page_size": 20, "skip": 0, "products": [...]}

With --all, they return a flat array of all products across all pages:

[{"code": "...", "product_name": "..."}, ...]

Single product lookups return the product object directly (no envelope).

Error Handling

Always check exit code. On failure, parse stderr for the error message:

result=$(openfoodfacts --json products get 0000000000000 2>err.tmp) || {
  error=$(cat err.tmp)
  # handle error
}

Rate Limits

CommandLimit
products get100 req/min
products search10 req/min
facets list2 req/min

If you exceed limits, the CLI exits 1 with {"error": "rate limit exceeded"}.

Available Commands

  • Products: openfoodfacts products get <barcode> · openfoodfacts products search [flags...]
  • Facets: openfoodfacts facets list <type>

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.