Dietly API lets developers fetch nutrition data with minimal Python code
Dietly offers a public nutrition catalog accessible via a simple HTTP GET request to its search endpoint, requiring only a query parameter of at least two characters. Developers can retrieve food data including macronutrients, calories, and serving details, all returned as a flat JSON array with values measured per 100 grams. The API also supports direct food lookups by ID and barcode scanning using EAN or UPC codes, returning a 404 status when no match is found. Nutrient fields can be null when source labels lack the information, and developers are advised to treat null as unknown rather than zero. A lightweight Python client class can be built to centralise the base URL, timeout, and optional API key, enabling structured and reliable nutrition lookups without a heavy SDK.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in