A while back I put a food and nutrition API on RapidAPI. You search any food and get calories and macros, plus barcode lookup, allergen detection, a health score, diet filters and a meal calculator. It's Express and TypeScript on Vercel, using data from USDA FoodData Central and Open Food Facts.
54 people signed up for the free plan. Nobody upgraded. This week I finally dug into why and found two embarrassing problems:
Every lookup by food ID returned 0 calories. USDA's search returns nutrients as {nutrientId, value}, but its single-food lookup nests them as {nutrient: {id}, amount}. My code only read the first format. Search looked fine, but anyone who clicked into a food saw a banana with 0 calories. The fix was one small function that converts the format.
The API was free to anyone who looked. My docs showed the raw Vercel URL, and the server never checked that requests came through RapidAPI, so the paid plans were optional.…