Runnable Python and Node scripts for the Calorie API food database: search, barcode lookup, and macros per 100g.
- Docs: calorieapi.com/docs
- OpenAPI: calorieapi.com/openapi.json
- Playground (no key): calorieapi.com/playground
- Free API key: calorieapi.com/auth/register
Works three ways:
- Public demo — no key, rate-limited (
/api/v1/public/...) - Direct —
X-API-Keyagainsthttps://calorieapiadmin.com - RapidAPI Hub —
X-RapidAPI-Key+X-RapidAPI-Hostafter you subscribe to the listing
No packages required. Python 3.9+ or Node 18+.
git clone https://github.com/Busybody1/calorie-api-examples.git
cd calorie-api-examples
python3 search_foods.py "chicken breast"
node search_foods.mjs "chicken breast"With a key from the site:
export CALORIE_API_KEY="your_key"
python3 search_foods.py appleVia RapidAPI (copy Host from the Hub Code Snippets panel):
export RAPIDAPI_KEY="your_rapidapi_key"
export RAPIDAPI_HOST="your-api.p.rapidapi.com"
python3 search_foods.py appleDirect:
curl "https://calorieapiadmin.com/api/v1/search/foods?q=apple&limit=5" \
-H "X-API-Key: your_key"RapidAPI:
curl "https://your-api.p.rapidapi.com/api/v1/search/foods?q=apple&limit=5" \
-H "X-RapidAPI-Key: your_rapidapi_key" \
-H "X-RapidAPI-Host: your-api.p.rapidapi.com"Public demo (30 requests/hour/IP):
curl "https://calorieapiadmin.com/api/v1/public/search/foods?q=apple&limit=5"Paste this repository URL into the listing GitHub field so Hub subscribers land here. Paste the curl/Python/Node snippets above into endpoint examples. Backend base URL for the listing is https://calorieapiadmin.com (authenticated /api/v1/... routes, not /api/v1/public/...).
python3 -m unittest test_calorieapi.py -v
node --test calorieapi.test.mjsMIT. Product and API: BusyBody FIT LTD.