Recipe - Food - Nutrition

FREEMIUM
By spoonacular
Updated 3 months ago
Food
9.8/10
Popularity Score
778ms
Latency
99%
Success Rate
flkn.haz2 months ago
Getting a 401 status The API all of a sudden began to return as unauthorised with a 401 status. I am well within my plans limits and have not changed my credentials. What's going on? body : { "message": { "status": "failure", "code": 401, "message": "You are not authorized." }, "error": { "message": { "status": "failure", "code": 401, "message": "You are not authorized." }, "status": 401 } }
spoonacular2 months ago
This issue should be resolved now. Please contact [email protected] if you are still experiencing difficulties.
Hi Developer, feel free to post your answer:

Install SDK for NodeJS

Installing

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

unirest.get("https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/quickAnswer?q=How+much+vitamin+c+is+in+2+apples%3F")
.header("X-RapidAPI-Host", "spoonacular-recipe-food-nutrition-v1.p.rapidapi.com")
.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