Recipe - Food - Nutrition

FREEMIUM
By spoonacular
Updated 3 months ago
Food
9.8/10
Popularity Score
778ms
Latency
99%
Success Rate
davidm3112 months ago
HttpUrlConnection - Android AppHi, Getting errors when using HttpResponse for Unirest.get requests in an Android App. Is it possible to use HttpUrlConnection and if so what would an example request look like? Thanks
spoonacular2 months ago
Hi David, since that is not a spoonacular API specific question I'd recommend you ask that at Stack Overflow.
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