Share your code.
Nutritionix API v2.0 Beta NodeJS Client Library
NOTE This library is still in beta and subject to change.
npm install nutritionix --save
// Require inside your projectvar NutritionixClient = ;var nutritionix =appId: 'YOUR_APP_ID'appKey: 'YOUR_APP_KEY'// debug: true, // defaults to false;
Execute an autocomplete query
// This will perform a fuzzy autocomplete query and return suggestionsnutritionix;
Execute a natural search
var ingredients ='1 tbsp sugar''1 red pepper';// ensure you are passing a string with queries delimited by new lines.nutritionix;
Get Item By
id or search
// this will locate an item by its (id, resource_id, or upc)nutritionix;;
Get Brand By
// this will locate a brand by its idnutritionix;
// This will perform a search. The object passed into this function// can contain all the perameters the API accepts in the `POST /v2/search` endpointnutritionixsearch;
// This will perform a search. The object passed into this function// can contain all the perameters the API accepts in the `GET /v2/search/brands` endpointnutritionix;
Take a look
tests/index.js for an end to end usecase for these libraries.