Back to feed
Dev.to
Dev.to
7/17/2026
Taming Open Food Facts: building a fast, searchable nutrition database

Taming Open Food Facts: building a fast, searchable nutrition database

Short summary

DietlyAPI is a cleaned, searchable nutrition database built from Open Food Facts' 4.2M products, serving ~40ms searches on a single 4GB Hetzner box. The cleanup involved canonicalizing serving units, running plausibility checks for jointly impossible values, and ranking duplicates by a confidence score. The post details the data pipeline architecture (FastAPI + Postgres with trigram indexes, Cloudflare CDN, pre-rendered static pages) and offers a free API tier at 30 req/min.

  • Cleaned 4.2M Open Food Facts products into a fast searchable API with ~40ms latency
  • Key challenges: unit normalization, plausibility checks, and duplicate ranking via confidence scores
  • Runs on a single 4GB server with FastAPI, Postgres, and Cloudflare; free tier available

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more