Skip to content
DDataNest

Data & Intelligence · 4 min read

How to use the Food Intelligence API in Python & JavaScript

Turning messy public data into something usable is most of the work. The Food Intelligence API hands you clean JSON instead.

By DataNest · Published May 2026

What the Food Intelligence API does

Barcode-driven nutrition intelligence over 3M+ products: health scores, allergen detection, structured nutrition, and product comparison. Responses are JSON, the API runs behind the RapidAPI gateway for auth and rate limiting, and there's a free tier for prototyping.

When to use it

diet tracking apps
meal planners
fitness macro tracking

The example request

GET https://food-intelligence-by-datanest.p.rapidapi.com/product/737628064502?barcode=737628064502

Example JSON response

An illustrative response body — run the live demo for the real thing.

{
  "query": "737628064502",
  "product": "Thai peanut noodle kit",
  "servingSize": "85g",
  "calories": 350,
  "macros": {
    "proteinG": 9,
    "carbsG": 47,
    "fatG": 14
  },
  "healthScore": 62,
  "allergens": [
    "peanuts",
    "soy",
    "wheat"
  ]
}

Common parameters

Every request also needs your RapidAPI auth headers.

ParameterInRequiredExample
x-rapidapi-keyheaderYesYOUR_RAPIDAPI_KEY
x-rapidapi-hostheaderYesfood-intelligence-by-datanest.p.rapidapi.com

Step by step

1. Subscribe and get your key

Open the Food Intelligence API on RapidAPI, subscribe to the free BASIC plan, and copy your X-RapidAPI-Key.

2. Call the endpoint

The example call for this API is shown above. The quick-start snippets below send exactly that request in cURL, Python and Node so you get a real response on the first try.

3. Try it without code first

The Food Intelligence page has a live "Try it" panel — change the input, run it, and inspect the real JSON before you integrate.

4. Integrate and cache

Call it from your backend and cache responses where it makes sense. Most responses change slowly, so even a daily cache keeps you well within the free tier.

Quick-start code

curl --request GET \
  --url 'https://food-intelligence-by-datanest.p.rapidapi.com/product/737628064502' \
  --header 'x-rapidapi-host: food-intelligence-by-datanest.p.rapidapi.com' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'

What you can build

Calorie tracker

Let users log meals by name or barcode and auto-fill nutrition.

Meal planner

Sum macros across a planned week and flag allergen conflicts.

Menu nutrition

Add a calorie and macro breakdown to every restaurant dish.

Wrapping up

If your project needs diet tracking apps, the Food Intelligence API removes the part nobody enjoys building. It's one of 23 in the DataNest collection — grab a free key and make your first call.

Food Intelligence updates

New Food Intelligence guides and endpoint updates, occasionally.