The spoonacular Nutrition, Recipe, and Food API allows you to access over thousands of recipes, thousands of ingredients, 800,000 food products, over 100,000 menu items, and restaurants. 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.
To install the required dependencies and to build the elixir project, run:
mix local.hex --force
mix do deps.get, compile
If available in Hex, the package can be installed by adding spoonacular
to
your list of dependencies in mix.exs
:
def deps do
[{:spoonacular, "~> 2.0.2"}]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/spoonacular.
You can override the URL of your server (e.g. if you have a separate development and production server in your configuration files).
config :spoonacular, base_url: "https://api.spoonacular.com"
Multiple clients for the same API with different URLs can be created passing different base_url
s when calling
SpoonacularAPI.Connection.new/1
:
client = SpoonacularAPI.Connection.new(base_url: "https://api.spoonacular.com")