Developers

Developer guides

Everything needed to ship against DietlyAPI: runnable quickstarts, AI-client integrations, straight comparisons with the other nutrition APIs, and hard-won notes on what makes food data difficult.

Start here

Working code you can paste and run against the live API.

Python nutrition API quickstart

Search the catalog in ten lines, then add a client class, error handling, retries and rate-limit safety.

Build a calorie tracker

A working tracker with food search, a daily log and local persistence, with complete runnable code.

Build a nutrition Custom GPT

Connect a Custom GPT to live data with an OpenAPI action, grounded instructions and safety checks.

Build an MCP nutrition server

Wrap DietlyAPI as an MCP server so Claude, Cursor and other AI clients use real data instead of guessing.

Compare nutrition APIs

Price, rate limits, data coverage and features, measured rather than marketed.

Nutrition API comparison (2026)

Seven providers side by side: Open Food Facts, USDA FoodData Central, FatSecret, Edamam, Spoonacular, Nutritionix and DietlyAPI.

DietlyAPI vs Edamam

How the two compare on price, rate limits, data and features for food search and nutrition lookup.

DietlyAPI vs Spoonacular

Food search and barcodes versus recipe tooling, and where each one is actually the right pick.

DietlyAPI vs Nutritionix

Pricing model, data and features for food search, barcodes and natural-language logging.

DietlyAPI vs FatSecret

How DietlyAPI and FatSecret's Platform API compare on price, rate limits, data and features.

Working with food data

The problems every nutrition app hits once real users show up.

Why fuzzy search alone produces bad results

Typos, brands, duplicates and sparse records, and how confidence-aware ranking changes the result list.

Reliable barcode lookup

Normalize GTINs safely, validate scanner input, rank duplicate records and design a useful no-match flow.

Handling missing data without lying to users

Model nullable nutrients, distinguish zero from unknown, and design honest fallbacks for incomplete records.

Contract testing a nutrition API

Frozen response contracts, nullability tests, representative fixtures and production probes over messy data.

What ODbL means for commercial apps

Attribution, produced works, derivative databases and image rights when using ODbL data commercially.

Running it in production

Operational guides for an integration that is already live.

Every DietlyAPI error explained

Real response bodies for 401, 403, 404, 422 and 429, the shape change that breaks parsers, and a retry policy that honours Retry-After.

Caching strategies for nutrition APIs

TTLs per data type, negative caching, key normalisation, and the arithmetic that decides which plan you need.

API key hygiene: scopes, expiry and rotation

One key per service, read scope by default, per-key rate caps, and a rotation you have practised before you need it.

Ready to build?

Free tier, no credit card. 4.2M foods, barcode lookup and ~40ms search.

Get an API key