Nutritionix - Nutrition Database

By msilverman
Updated 23 days ago
Popularity Score
Success Rate
Reggz4 years ago
error 401 unauthorized accessHello nutriionix team, today I'm testing my application and try to call the nutritionix api, but it said unauthorized access and the API could not understand the request, what should I do to solve this? Here is the error shown:The API could not understand the request. Please review your parameters before making any new attempt. HTTP/1.1 401 Unauthorized They said I must provide appId and appKey, where do I get these key?
msilverman4 years ago
Our API always required an API key.
Reggz4 years ago
Thanks mate. I've just resolved it right before you posted :). Anw, since when did it require an API key?
msilverman4 years ago
You can get your free API key here: Thanks!
Hi Developer, feel free to post your answer:

Install SDK for NodeJS


To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

.header("X-RapidAPI-Host", "")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication