New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nutritionix

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nutritionix

Official Nutritionix NodeJS Client Library

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-58.33%
Maintainers
1
Weekly downloads
 
Created
Source

Official Nutritionix NodeJS Client

NOTE This is still in beta and the API may change until version 1.0
NOTE v1 of the API is currently not yet implemented

Installation

npm install nutritionix --save
// Require inside your project
var nutritionix = require('nutritionix')({
    appId: 'YOUR_APP_ID',
    appKey: 'YOUR_APP_KEY'
}, false);

// Second argument false can be changed to true
// This will tell the library to enter debugging mode
// and log additional data to the console

UPC Scan

// GET https://api.nutritionix.com/v1_1/item?upc=52200004265
nutritionix.v1_1.item({
    upc: 52200004265
}, function (err, item) {
    // ...
});

Get Item by id

// GET https://api.nutritionix.com/v1_1/item?upc=52200004265
nutritionix.v1_1.item({
    id: '5284ebc52504590000003f4a'
}, function (err, item) {
    // ...
});

Get Brand By ID

// GET https://api.nutritionix.com/v1_1/brand/51db37c3176fe9790a8991f6
nutritionix.v1_1.brand({
    id: '51db37c3176fe9790a8991f6'
}, function (err, brand){
    // ...
});
// GET https://api.nutritionix.com/v1_1/search/mcdonalds?results=0:1
nutritionix.v1_1.search.standard({
    phrase: 'mcdonalds',
    results: '0:1'
}, function (err, results){
    // ...
});
// POST https://api.nutritionix.com/v1_1/search -d DATA
nutritionix.v1_1.search.advanced({
    fields: ['item_name','brand_name'],
    query: 'mcdonalds',
    offset:0,
    limit:1
}, function (err, results){
    // ...
});
// GET https://api.nutritionix.com/v1_1/brand/search?query=just+salad&auto=true&type=1&min_score=1
nutritionix.v1_1.search.brand({
    query:'just salad',
    auto:true,
    type:1,
    min_score:1
}, function (err, results){
    // ...
});
Special thanks

Thank you to picsoung for allowing us to take over the npm package and inspiring us to create an official nodejs client.

Keywords

FAQs

Package last updated on 20 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc