DEV Community

incoinco
incoinco

Posted on

I built a nutrition API for a side project, sharing it here in case anyone finds it useful

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

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.

Top comments (2)

Collapse
 
sona_badalyan_90b4c977526 profile image
Sona Badalyan •

Great! Thank you for sharing

Collapse
 
inco profile image
incoinco •

youre welcome!