Yummly.com is one of the world’s largest and most powerful recipe search site. Moreover, it more or less consistent API endpoints for searching and retreiving recipes and this packages aims to provide R bindings for those endpoints.
This document is not intended to be exhaustive nor comprehensive but rather a brief introduction to some of the more common bits of functionality and some basic examples of how they can be used.
First of all, obtain an API credentials from Yummly.com.
After that you can use save_yummly_credentials
to presist the application ID
and application key
between querries, or supply the directly to search_recipes
and get_recipe
functions.
search_recipes
function corresponds to Search Recipes API call and is used to search for recipes fitting certain criterias. Example search response. Simplest call looks like this:
search_recipes('bacon')
YummlyR supports wide variety of criterias:
require_pictures
set to TRUE if only to return recipes with photosallowed_ingredient
ingredient that all search results must includeexcluded_ingredient
ingredient that all search results should not containallowed_diet
search results will only include recipes whose ingredients are allowed for that dietallowed_allergy
only include recipes whose ingredients are allowed for that allergyallowed_cuisine
search results will only include recipes with that cuisineexcluded_cuisine
search results will only exclude recipes with that cuisineallowed_course
search results will only include recipes with that cuisineexcluded_course
search results will only exclude recipes with that cuisineexcluded_holiday
search results will only exclude recipes with that holidaymax_total_time
search for recipes that do not exceed a specified max total cook + prep time in secondsmax_results
number of results to returnstart
start with specific result in searchnutrition
set the range of allowed values for a given nutrition attribute (see below for the list of supported nutrition attributes) by setting a min and/or a maxflavor
set the ranges for taste attributes (this corresponds to the taste sliders on the Yummly.com search page). The values of min and max are between 0 and 1.facet_field
facet counts for ingredient and diet. When this parameter is called, the response will include a facetCounts object that lists the matching diets or ingredients and how many results match each diet or ingredient.For example,
search_recipes("onion soup", allowed_ingredient = "bacon")
will return onion soup recipes that have bacon as one of the ingredients. More detailed expanations of Yummly’s Search API with example can be found here.
NOTE: Allowed values for ingeredient
, diet
, allergy
, cuisine
, course
, holiday
, nutrition
and flavor
are defined by Yummly.com metadata and saved inside the package for convenience. Available metadata can be accessed using get_metadata
function, for example,
get_metadata('holiday')
will return you data.frame
with information about available holiday
keywords.
Fetch a recipe by its recipe ID. Example recipe response. For example,
get_recipe("French-Onion-Soup-The-Pioneer-Woman-Cooks-_-Ree-Drummond-41364")
returns a detailed information about French Onion Soup.