rayat_spoonacular_api
v1.1.0
Published
The_spoonacular_Nutrition_Recipe_and_Food_API_allows_you_to_access_over_380000_recipes_thousands_of_ingredients_80000_food_products_and_100000_menu_items__Our_food_ontology_and_semantic_recipe_search_engine_makes_it_possible_to_search_for_recipes_using_na
Downloads
3
Readme
spoonacular_api
SpoonacularApi - JavaScript client for spoonacular_api The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 80,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such as "gluten free brownies without sugar" or "low fat vegan cupcakes." You can automatically calculate the nutritional information for any recipe, analyze recipe costs, visualize ingredient lists, find recipes for what's in your fridge, find recipes based on special diets, nutritional requirements, or favorite ingredients, classify recipes into types and cuisines, convert ingredient amounts, or even compute an entire meal plan. With our powerful API, you can create many kinds of food and especially nutrition apps. Special diets/dietary requirements currently available include: vegan, vegetarian, pescetarian, gluten free, grain free, dairy free, high protein, whole 30, low sodium, low carb, Paleo, ketogenic, FODMAP, and Primal. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0
- Package version: 1.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://spoonacular.com/contact
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install spoonacular_api --save
Finaly, you need to build the module:
npm run build
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
To use the link you just defined in your project, switch to the directory you want to use your spoonacular_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
Finaly, you need to build the module:
npm run build
git
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var SpoonacularApi = require('spoonacular_api');
var api = new SpoonacularApi.DefaultApi()
var username = dsky; // {String} The username.
var hash = 4b5v4398573406; // {String} The private hash for the username.
var inlineObject11 = new SpoonacularApi.InlineObject11(); // {InlineObject11}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addToMealPlan(username, hash, inlineObject11, callback);
Documentation for API Endpoints
All URIs are relative to https://api.spoonacular.com
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- SpoonacularApi.DefaultApi | addToMealPlan | POST /mealplanner/{username}/items | Add to Meal Plan SpoonacularApi.DefaultApi | addToShoppingList | POST /mealplanner/{username}/shopping-list/items | Add to Shopping List SpoonacularApi.DefaultApi | analyzeARecipeSearchQuery | GET /recipes/queries/analyze | Analyze a Recipe Search Query SpoonacularApi.DefaultApi | analyzeRecipeInstructions | POST /recipes/analyzeInstructions | Analyze Recipe Instructions SpoonacularApi.DefaultApi | autocompleteIngredientSearch | GET /food/ingredients/autocomplete | Autocomplete Ingredient Search SpoonacularApi.DefaultApi | autocompleteMenuItemSearch | GET /food/menuItems/suggest | Autocomplete Menu Item Search SpoonacularApi.DefaultApi | autocompleteProductSearch | GET /food/products/suggest | Autocomplete Product Search SpoonacularApi.DefaultApi | autocompleteRecipeSearch | GET /recipes/autocomplete | Autocomplete Recipe Search SpoonacularApi.DefaultApi | classifyCuisine | POST /recipes/cuisine | Classify Cuisine SpoonacularApi.DefaultApi | classifyGroceryProduct | POST /food/products/classify | Classify Grocery Product SpoonacularApi.DefaultApi | classifyGroceryProductBulk | POST /food/products/classifyBatch | Classify Grocery Product Bulk SpoonacularApi.DefaultApi | clearMealPlanDay | DELETE /mealplanner/{username}/day/{date} | Clear Meal Plan Day SpoonacularApi.DefaultApi | computeGlycemicLoad | POST /food/ingredients/glycemicLoad | Compute Glycemic Load SpoonacularApi.DefaultApi | connectUser | POST /users/connect | Connect User SpoonacularApi.DefaultApi | convertAmounts | GET /recipes/convert | Convert Amounts SpoonacularApi.DefaultApi | createRecipeCard | POST /recipes/visualizeRecipe | Create Recipe Card SpoonacularApi.DefaultApi | deleteFromMealPlan | DELETE /mealplanner/{username}/items/{id} | Delete from Meal Plan SpoonacularApi.DefaultApi | deleteFromShoppingList | DELETE /mealplanner/{username}/shopping-list/items/{id} | Delete from Shopping List SpoonacularApi.DefaultApi | detectFoodInText | POST /food/detect | Detect Food in Text SpoonacularApi.DefaultApi | extractRecipeFromWebsite | GET /recipes/extract | Extract Recipe from Website SpoonacularApi.DefaultApi | generateMealPlan | GET /mealplanner/generate | Generate Meal Plan SpoonacularApi.DefaultApi | generateShoppingList | POST /mealplanner/{username}/shopping-list/{start-date}/{end-date} | Generate Shopping List SpoonacularApi.DefaultApi | getARandomFoodJoke | GET /food/jokes/random | Get a Random Food Joke SpoonacularApi.DefaultApi | getAnalyzedRecipeInstructions | GET /recipes/{id}/analyzedInstructions | Get Analyzed Recipe Instructions SpoonacularApi.DefaultApi | getComparableProducts | GET /food/products/upc/{upc}/comparable | Get Comparable Products SpoonacularApi.DefaultApi | getConversationSuggests | GET /food/converse/suggest | Get Conversation Suggests SpoonacularApi.DefaultApi | getDishPairingForWine | GET /food/wine/dishes | Get Dish Pairing for Wine SpoonacularApi.DefaultApi | getIngredientInformation | GET /food/ingredients/{id}/information | Get Ingredient Information SpoonacularApi.DefaultApi | getIngredientSubstitutes | GET /food/ingredients/substitutes | Get Ingredient Substitutes SpoonacularApi.DefaultApi | getIngredientSubstitutesByID | GET /food/ingredients/{id}/substitutes | Get Ingredient Substitutes by ID SpoonacularApi.DefaultApi | getMealPlanTemplate | GET /mealplanner/{username}/templates/{id} | Get Meal Plan Template SpoonacularApi.DefaultApi | getMealPlanTemplates | GET /mealplanner/{username}/templates | Get Meal Plan Templates SpoonacularApi.DefaultApi | getMealPlanWeek | GET /mealplanner/{username}/week/{start-date} | Get Meal Plan Week SpoonacularApi.DefaultApi | getMenuItemInformation | GET /food/menuItems/{id} | Get Menu Item Information SpoonacularApi.DefaultApi | getProductInformation | GET /food/products/{id} | Get Product Information SpoonacularApi.DefaultApi | getRandomFoodTrivia | GET /food/trivia/random | Get Random Food Trivia SpoonacularApi.DefaultApi | getRandomRecipes | GET /recipes/random | Get Random Recipes SpoonacularApi.DefaultApi | getRecipeEquipmentByID | GET /recipes/{id}/equipmentWidget.json | Get Recipe Equipment by ID SpoonacularApi.DefaultApi | getRecipeInformation | GET /recipes/{id}/information | Get Recipe Information SpoonacularApi.DefaultApi | getRecipeInformationBulk | GET /recipes/informationBulk | Get Recipe Information Bulk SpoonacularApi.DefaultApi | getRecipeIngredientsByID | GET /recipes/{id}/ingredientWidget.json | Get Recipe Ingredients by ID SpoonacularApi.DefaultApi | getRecipeNutritionWidgetByID | GET /recipes/{id}/nutritionWidget.json | Get Recipe Nutrition Widget by ID SpoonacularApi.DefaultApi | getRecipePriceBreakdownByID | GET /recipes/{id}/priceBreakdownWidget.json | Get Recipe Price Breakdown by ID SpoonacularApi.DefaultApi | getRecipeTasteByID | GET /recipes/{id}/tasteWidget.json | Get Recipe Taste by ID SpoonacularApi.DefaultApi | getShoppingList | GET /mealplanner/{username}/shopping-list | Get Shopping List SpoonacularApi.DefaultApi | getSimilarRecipes | GET /recipes/{id}/similar | Get Similar Recipes SpoonacularApi.DefaultApi | getWineDescription | GET /food/wine/description | Get Wine Description SpoonacularApi.DefaultApi | getWinePairing | GET /food/wine/pairing | Get Wine Pairing SpoonacularApi.DefaultApi | getWineRecommendation | GET /food/wine/recommendation | Get Wine Recommendation SpoonacularApi.DefaultApi | guessNutritionByDishName | GET /recipes/guessNutrition | Guess Nutrition by Dish Name SpoonacularApi.DefaultApi | imageAnalysisByURL | GET /food/images/analyze | Image Analysis by URL SpoonacularApi.DefaultApi | imageClassificationByURL | GET /food/images/classify | Image Classification by URL SpoonacularApi.DefaultApi | ingredientSearch | GET /food/ingredients/search | Ingredient Search SpoonacularApi.DefaultApi | mapIngredientsToGroceryProducts | POST /food/ingredients/map | Map Ingredients to Grocery Products SpoonacularApi.DefaultApi | parseIngredients | POST /recipes/parseIngredients | Parse Ingredients SpoonacularApi.DefaultApi | quickAnswer | GET /recipes/quickAnswer | Quick Answer SpoonacularApi.DefaultApi | searchAllFood | GET /food/search | Search All Food SpoonacularApi.DefaultApi | searchCustomFoods | GET /food/customFoods/search | Search Custom Foods SpoonacularApi.DefaultApi | searchFoodVideos | GET /food/videos/search | Search Food Videos SpoonacularApi.DefaultApi | searchGroceryProducts | GET /food/products/search | Search Grocery Products SpoonacularApi.DefaultApi | searchGroceryProductsByUPC | GET /food/products/upc/{upc} | Search Grocery Products by UPC SpoonacularApi.DefaultApi | searchMenuItems | GET /food/menuItems/search | Search Menu Items SpoonacularApi.DefaultApi | searchRecipes | GET /recipes/complexSearch | Search Recipes SpoonacularApi.DefaultApi | searchRecipesByIngredients | GET /recipes/findByIngredients | Search Recipes by Ingredients SpoonacularApi.DefaultApi | searchRecipesByNutrients | GET /recipes/findByNutrients | Search Recipes by Nutrients SpoonacularApi.DefaultApi | searchSiteContent | GET /food/site/search | Search Site Content SpoonacularApi.DefaultApi | summarizeRecipe | GET /recipes/{id}/summary | Summarize Recipe SpoonacularApi.DefaultApi | talkToChatbot | GET /food/converse | Talk to Chatbot SpoonacularApi.DefaultApi | visualizeEquipment | POST /recipes/visualizeEquipment | Visualize Equipment SpoonacularApi.DefaultApi | visualizeIngredients | POST /recipes/visualizeIngredients | Visualize Ingredients SpoonacularApi.DefaultApi | visualizeMenuItemNutritionByID | GET /food/menuItems/{id}/nutritionWidget | Visualize Menu Item Nutrition by ID SpoonacularApi.DefaultApi | visualizePriceBreakdown | POST /recipes/visualizePriceEstimator | Visualize Price Breakdown SpoonacularApi.DefaultApi | visualizeProductNutritionByID | GET /food/products/{id}/nutritionWidget | Visualize Product Nutrition by ID SpoonacularApi.DefaultApi | visualizeRecipeEquipmentByID | GET /recipes/{id}/equipmentWidget | Visualize Recipe Equipment by ID SpoonacularApi.DefaultApi | visualizeRecipeIngredientsByID | GET /recipes/{id}/ingredientWidget | Visualize Recipe Ingredients by ID SpoonacularApi.DefaultApi | visualizeRecipeNutrition | POST /recipes/visualizeNutrition | Visualize Recipe Nutrition SpoonacularApi.DefaultApi | visualizeRecipeNutritionByID | GET /recipes/{id}/nutritionWidget | Visualize Recipe Nutrition by ID SpoonacularApi.DefaultApi | visualizeRecipePriceBreakdownByID | GET /recipes/{id}/priceBreakdownWidget | Visualize Recipe Price Breakdown by ID SpoonacularApi.DefaultApi | visualizeRecipeTaste | POST /recipes/visualizeTaste | Visualize Recipe Taste SpoonacularApi.DefaultApi | visualizeRecipeTasteByID | GET /recipes/{id}/tasteWidget | Visualize Recipe Taste by ID
Documentation for Models
- SpoonacularApi.InlineObject
- SpoonacularApi.InlineObject1
- SpoonacularApi.InlineObject10
- SpoonacularApi.InlineObject11
- SpoonacularApi.InlineObject12
- SpoonacularApi.InlineObject13
- SpoonacularApi.InlineObject14
- SpoonacularApi.InlineObject15
- SpoonacularApi.InlineObject16
- SpoonacularApi.InlineObject2
- SpoonacularApi.InlineObject3
- SpoonacularApi.InlineObject4
- SpoonacularApi.InlineObject5
- SpoonacularApi.InlineObject6
- SpoonacularApi.InlineObject7
- SpoonacularApi.InlineObject8
- SpoonacularApi.InlineObject9
Documentation for Authorization
apiKeyScheme
- Type: API key
- API key parameter name: api_key
- Location: URL query string