I've been working on a small side project and ended up building a nutrition API to solve a problem I kept running into: every food-related app needs the same data (calories, macros, ingredients), but there's no easy way to get it without either paying hundreds a month or scraping nutrition labels off the web.

So I packaged Open Food Facts — a free, open database with 3M+ products — into a clean REST API and put it on RapidAPI.

What it does

Two main endpoints:

Search by name
GET /food/search?q=nutella

Returns the top matching products with brand, image, and Nutri-Score grade.

Look up by barcode
GET /food/barcode/3017620422003

Returns the full nutrition panel: calories, fat, saturated fat, carbohydrates, sugars, proteins, salt, fiber, plus ingredients and Nutri-Score.

Example response

{
"id": "3017620422003",
"name": "Nutella",
"brand": "Ferrero",
"nutrition_grade": "e",
"nutriments": {
"energy_kcal": 539,
"fat": 30.9,
"sugars": 56.3,
"proteins": 6.3
}
}

What it's useful for

  • Calorie counters and macro trackers
  • Meal planners and recipe apps
  • Barcode scanner apps
  • Diet dashboards
  • Fitness companion apps

What I learned building it

A few things I didn't expect:

  1. The upstream search API (Open Food Facts) is flaky — goes down regularly. Barcode lookup is much more stable.
  2. Caching everything for 24 hours cuts external dependency by ~90% and makes responses instant.
  3. RapidAPI's pricing model is more flexible than I thought — you can set up freemium tiers in about 10 minutes.

Try it

There's a free tier if anyone wants to test it out. Would love honest feedback — what's missing, what would make it more useful, what would make you actually use it in a project.

my project : https://rapidapi.com/kanenas-FTyg1YyYI/api/food-nutrition-api3

Still iterating on it. If you're building something in this space, feel free to reach out.