Foxtrot47 / spoonacular_api

Spoonacular API Client taken from https://spoonacular.com/food-api/sdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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, 800,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

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 defaultClient = SpoonacularApi.ApiClient.instance;
// Configure API key authorization: apiKeyScheme
var apiKeyScheme = defaultClient.authentications['apiKeyScheme'];
apiKeyScheme.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKeyScheme.apiKeyPrefix['apiKey'] = "Token"

var api = new SpoonacularApi.IngredientsApi()
var opts = {
  'query': burger, // {String} The (natural language) search query.
  '_number': 10, // {Number} The maximum number of items to return (between 1 and 100). Defaults to 10.
  'metaInformation': false, // {Boolean} Whether to return more meta information about the ingredients.
  'intolerances': egg // {String} A comma-separated list of intolerances. All recipes returned must not contain ingredients that are not suitable for people with the intolerances entered. See a full list of supported intolerances.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.autocompleteIngredientSearch(opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api.spoonacular.com

Class Method HTTP request Description
SpoonacularApi.IngredientsApi autocompleteIngredientSearch GET /food/ingredients/autocomplete Autocomplete Ingredient Search
SpoonacularApi.IngredientsApi computeIngredientAmount GET /food/ingredients/{id}/amount Compute Ingredient Amount
SpoonacularApi.IngredientsApi getIngredientInformation GET /food/ingredients/{id}/information Get Ingredient Information
SpoonacularApi.IngredientsApi getIngredientSubstitutes GET /food/ingredients/substitutes Get Ingredient Substitutes
SpoonacularApi.IngredientsApi getIngredientSubstitutesByID GET /food/ingredients/{id}/substitutes Get Ingredient Substitutes by ID
SpoonacularApi.IngredientsApi ingredientSearch GET /food/ingredients/search Ingredient Search
SpoonacularApi.IngredientsApi ingredientsByIDImage GET /recipes/{id}/ingredientWidget.png Ingredients by ID Image
SpoonacularApi.IngredientsApi mapIngredientsToGroceryProducts POST /food/ingredients/map Map Ingredients to Grocery Products
SpoonacularApi.IngredientsApi visualizeIngredients POST /recipes/visualizeIngredients Ingredients Widget
SpoonacularApi.MealPlanningApi addMealPlanTemplate POST /mealplanner/{username}/templates Add Meal Plan Template
SpoonacularApi.MealPlanningApi addToMealPlan POST /mealplanner/{username}/items Add to Meal Plan
SpoonacularApi.MealPlanningApi addToShoppingList POST /mealplanner/{username}/shopping-list/items Add to Shopping List
SpoonacularApi.MealPlanningApi clearMealPlanDay DELETE /mealplanner/{username}/day/{date} Clear Meal Plan Day
SpoonacularApi.MealPlanningApi connectUser POST /users/connect Connect User
SpoonacularApi.MealPlanningApi deleteFromMealPlan DELETE /mealplanner/{username}/items/{id} Delete from Meal Plan
SpoonacularApi.MealPlanningApi deleteFromShoppingList DELETE /mealplanner/{username}/shopping-list/items/{id} Delete from Shopping List
SpoonacularApi.MealPlanningApi deleteMealPlanTemplate DELETE /mealplanner/{username}/templates/{id} Delete Meal Plan Template
SpoonacularApi.MealPlanningApi generateMealPlan GET /mealplanner/generate Generate Meal Plan
SpoonacularApi.MealPlanningApi generateShoppingList POST /mealplanner/{username}/shopping-list/{start-date}/{end-date} Generate Shopping List
SpoonacularApi.MealPlanningApi getMealPlanTemplate GET /mealplanner/{username}/templates/{id} Get Meal Plan Template
SpoonacularApi.MealPlanningApi getMealPlanTemplates GET /mealplanner/{username}/templates Get Meal Plan Templates
SpoonacularApi.MealPlanningApi getMealPlanWeek GET /mealplanner/{username}/week/{start-date} Get Meal Plan Week
SpoonacularApi.MealPlanningApi getShoppingList GET /mealplanner/{username}/shopping-list Get Shopping List
SpoonacularApi.MenuItemsApi autocompleteMenuItemSearch GET /food/menuItems/suggest Autocomplete Menu Item Search
SpoonacularApi.MenuItemsApi getMenuItemInformation GET /food/menuItems/{id} Get Menu Item Information
SpoonacularApi.MenuItemsApi menuItemNutritionByIDImage GET /food/menuItems/{id}/nutritionWidget.png Menu Item Nutrition by ID Image
SpoonacularApi.MenuItemsApi menuItemNutritionLabelImage GET /food/menuItems/{id}/nutritionLabel.png Menu Item Nutrition Label Image
SpoonacularApi.MenuItemsApi menuItemNutritionLabelWidget GET /food/menuItems/{id}/nutritionLabel Menu Item Nutrition Label Widget
SpoonacularApi.MenuItemsApi searchMenuItems GET /food/menuItems/search Search Menu Items
SpoonacularApi.MenuItemsApi visualizeMenuItemNutritionByID GET /food/menuItems/{id}/nutritionWidget Menu Item Nutrition by ID Widget
SpoonacularApi.MiscApi detectFoodInText POST /food/detect Detect Food in Text
SpoonacularApi.MiscApi getARandomFoodJoke GET /food/jokes/random Random Food Joke
SpoonacularApi.MiscApi getConversationSuggests GET /food/converse/suggest Conversation Suggests
SpoonacularApi.MiscApi getRandomFoodTrivia GET /food/trivia/random Random Food Trivia
SpoonacularApi.MiscApi imageAnalysisByURL GET /food/images/analyze Image Analysis by URL
SpoonacularApi.MiscApi imageClassificationByURL GET /food/images/classify Image Classification by URL
SpoonacularApi.MiscApi searchAllFood GET /food/search Search All Food
SpoonacularApi.MiscApi searchCustomFoods GET /food/customFoods/search Search Custom Foods
SpoonacularApi.MiscApi searchFoodVideos GET /food/videos/search Search Food Videos
SpoonacularApi.MiscApi searchSiteContent GET /food/site/search Search Site Content
SpoonacularApi.MiscApi talkToChatbot GET /food/converse Talk to Chatbot
SpoonacularApi.ProductsApi autocompleteProductSearch GET /food/products/suggest Autocomplete Product Search
SpoonacularApi.ProductsApi classifyGroceryProduct POST /food/products/classify Classify Grocery Product
SpoonacularApi.ProductsApi classifyGroceryProductBulk POST /food/products/classifyBatch Classify Grocery Product Bulk
SpoonacularApi.ProductsApi getComparableProducts GET /food/products/upc/{upc}/comparable Get Comparable Products
SpoonacularApi.ProductsApi getProductInformation GET /food/products/{id} Get Product Information
SpoonacularApi.ProductsApi productNutritionByIDImage GET /food/products/{id}/nutritionWidget.png Product Nutrition by ID Image
SpoonacularApi.ProductsApi productNutritionLabelImage GET /food/products/{id}/nutritionLabel.png Product Nutrition Label Image
SpoonacularApi.ProductsApi productNutritionLabelWidget GET /food/products/{id}/nutritionLabel Product Nutrition Label Widget
SpoonacularApi.ProductsApi searchGroceryProducts GET /food/products/search Search Grocery Products
SpoonacularApi.ProductsApi searchGroceryProductsByUPC GET /food/products/upc/{upc} Search Grocery Products by UPC
SpoonacularApi.ProductsApi visualizeProductNutritionByID GET /food/products/{id}/nutritionWidget Product Nutrition by ID Widget
SpoonacularApi.RecipesApi analyzeARecipeSearchQuery GET /recipes/queries/analyze Analyze a Recipe Search Query
SpoonacularApi.RecipesApi analyzeRecipeInstructions POST /recipes/analyzeInstructions Analyze Recipe Instructions
SpoonacularApi.RecipesApi autocompleteRecipeSearch GET /recipes/autocomplete Autocomplete Recipe Search
SpoonacularApi.RecipesApi classifyCuisine POST /recipes/cuisine Classify Cuisine
SpoonacularApi.RecipesApi computeGlycemicLoad POST /food/ingredients/glycemicLoad Compute Glycemic Load
SpoonacularApi.RecipesApi convertAmounts GET /recipes/convert Convert Amounts
SpoonacularApi.RecipesApi createRecipeCard POST /recipes/visualizeRecipe Create Recipe Card
SpoonacularApi.RecipesApi equipmentByIDImage GET /recipes/{id}/equipmentWidget.png Equipment by ID Image
SpoonacularApi.RecipesApi extractRecipeFromWebsite GET /recipes/extract Extract Recipe from Website
SpoonacularApi.RecipesApi getAnalyzedRecipeInstructions GET /recipes/{id}/analyzedInstructions Get Analyzed Recipe Instructions
SpoonacularApi.RecipesApi getRandomRecipes GET /recipes/random Get Random Recipes
SpoonacularApi.RecipesApi getRecipeEquipmentByID GET /recipes/{id}/equipmentWidget.json Equipment by ID
SpoonacularApi.RecipesApi getRecipeInformation GET /recipes/{id}/information Get Recipe Information
SpoonacularApi.RecipesApi getRecipeInformationBulk GET /recipes/informationBulk Get Recipe Information Bulk
SpoonacularApi.RecipesApi getRecipeIngredientsByID GET /recipes/{id}/ingredientWidget.json Ingredients by ID
SpoonacularApi.RecipesApi getRecipeNutritionWidgetByID GET /recipes/{id}/nutritionWidget.json Nutrition by ID
SpoonacularApi.RecipesApi getRecipePriceBreakdownByID GET /recipes/{id}/priceBreakdownWidget.json Price Breakdown by ID
SpoonacularApi.RecipesApi getRecipeTasteByID GET /recipes/{id}/tasteWidget.json Taste by ID
SpoonacularApi.RecipesApi getSimilarRecipes GET /recipes/{id}/similar Get Similar Recipes
SpoonacularApi.RecipesApi guessNutritionByDishName GET /recipes/guessNutrition Guess Nutrition by Dish Name
SpoonacularApi.RecipesApi ingredientsByIDImage GET /recipes/{id}/ingredientWidget.png Ingredients by ID Image
SpoonacularApi.RecipesApi parseIngredients POST /recipes/parseIngredients Parse Ingredients
SpoonacularApi.RecipesApi priceBreakdownByIDImage GET /recipes/{id}/priceBreakdownWidget.png Price Breakdown by ID Image
SpoonacularApi.RecipesApi quickAnswer GET /recipes/quickAnswer Quick Answer
SpoonacularApi.RecipesApi recipeNutritionByIDImage GET /recipes/{id}/nutritionWidget.png Recipe Nutrition by ID Image
SpoonacularApi.RecipesApi recipeNutritionLabelImage GET /recipes/{id}/nutritionLabel.png Recipe Nutrition Label Image
SpoonacularApi.RecipesApi recipeNutritionLabelWidget GET /recipes/{id}/nutritionLabel Recipe Nutrition Label Widget
SpoonacularApi.RecipesApi recipeTasteByIDImage GET /recipes/{id}/tasteWidget.png Recipe Taste by ID Image
SpoonacularApi.RecipesApi searchRecipes GET /recipes/complexSearch Search Recipes
SpoonacularApi.RecipesApi searchRecipesByIngredients GET /recipes/findByIngredients Search Recipes by Ingredients
SpoonacularApi.RecipesApi searchRecipesByNutrients GET /recipes/findByNutrients Search Recipes by Nutrients
SpoonacularApi.RecipesApi summarizeRecipe GET /recipes/{id}/summary Summarize Recipe
SpoonacularApi.RecipesApi visualizeEquipment POST /recipes/visualizeEquipment Equipment Widget
SpoonacularApi.RecipesApi visualizePriceBreakdown POST /recipes/visualizePriceEstimator Price Breakdown Widget
SpoonacularApi.RecipesApi visualizeRecipeEquipmentByID GET /recipes/{id}/equipmentWidget Equipment by ID Widget
SpoonacularApi.RecipesApi visualizeRecipeIngredientsByID GET /recipes/{id}/ingredientWidget Ingredients by ID Widget
SpoonacularApi.RecipesApi visualizeRecipeNutrition POST /recipes/visualizeNutrition Recipe Nutrition Widget
SpoonacularApi.RecipesApi visualizeRecipeNutritionByID GET /recipes/{id}/nutritionWidget Recipe Nutrition by ID Widget
SpoonacularApi.RecipesApi visualizeRecipePriceBreakdownByID GET /recipes/{id}/priceBreakdownWidget Price Breakdown by ID Widget
SpoonacularApi.RecipesApi visualizeRecipeTaste POST /recipes/visualizeTaste Recipe Taste Widget
SpoonacularApi.RecipesApi visualizeRecipeTasteByID GET /recipes/{id}/tasteWidget Recipe Taste by ID Widget
SpoonacularApi.WineApi getDishPairingForWine GET /food/wine/dishes Dish Pairing for Wine
SpoonacularApi.WineApi getWineDescription GET /food/wine/description Wine Description
SpoonacularApi.WineApi getWinePairing GET /food/wine/pairing Wine Pairing
SpoonacularApi.WineApi getWineRecommendation GET /food/wine/recommendation Wine Recommendation

Documentation for Models

Documentation for Authorization

apiKeyScheme

  • Type: API key
  • API key parameter name: apiKey
  • Location: URL query string

About

Spoonacular API Client taken from https://spoonacular.com/food-api/sdk

License:GNU General Public License v3.0


Languages

Language:JavaScript 99.9%Language:Shell 0.1%