Filtering and vocabularies

Recipes come from sites that each classify things their own way, so the pipeline maps everything onto closed lists. A filter takes a value from one of these lists — anything else is rejected with a message that says so.

The filters

All of these are optional and they combine. GET /recipes takes:

  • cuisine, course, dietone value from the closed list below.
  • category, ingredientone slug from an open set.
  • ingredients, excludeIngredients1 to 20 comma-separated names or ids. A recipe must carry every name in ingredients and none in excludeIngredients.
  • equipment1 to 20 comma-separated equipment names. A recipe must list every one of them.
  • languagea two-letter code, such as en.
  • maxTotalMinutes, maxCookMinutes1 to 10080 minutes, inclusive.
  • timea preset: under-15, under-30 or weekend.
  • maxCalories, maxSodium, minFiber, minProteinper-serving amounts: kilocalories, milligrams of sodium, grams of fiber and grams of protein. See below.
  • nutritionone or more presets: high-fiber, high-protein, low-calorie, low-sodium. See below.
  • limit, offseta page of 1 to 100 recipes, 20 by default, and where it starts.
curl 'https://api.tinyplates.dev/recipes?cuisine=italian&diet=vegetarian&maxTotalMinutes=30' \
  -H 'Authorization: Bearer rd_your_api_key'

diet only returns recipes known to suit it. A recipe whose flag is unknown is left out rather than guessed at, so a filtered list is safe to show to someone who actually needs it.

The lists below are also served live by GET /vocabularies, which is the version to build against — this page is a snapshot for reading.

Nutrition

Every nutrition filter is per serving and inclusive, and reads the figures the recipe was published with — nothing is recalculated.maxCalories takes kilocalories, maxSodium milligrams, and minFiber and minProtein grams. A recipe that published a nutrient in another unit is converted, not skipped.

A recipe that carries no nutrition is left out, the same way an unknown diet flag is. Filtering by nutrition therefore returns fewer recipes than the same filter without it.

nutrition takes one or more presets instead of numbers. Calories and protein are the everyday reading of the words; sodium and fiber use the US FDA's labelling thresholds, which are the only widely agreed numbers.

  • high-fiberat least 5 g of fiber per serving.
  • high-proteinat least 20 g of protein per serving.
  • low-calorieat most 400 kcal per serving.
  • low-sodiumat most 140 mg of sodium per serving.

A preset and an explicit amount for the same nutrient both apply, and the tighter of the two wins, so neither can quietly widen the other.

curl 'https://api.tinyplates.dev/recipes?nutrition=high-protein,low-calorie&maxSodium=500' \
  -H 'Authorization: Bearer rd_your_api_key'

Cuisines

  • african
  • american
  • argentinian
  • asian
  • australian
  • austrian
  • belgian
  • brazilian
  • british
  • cajun
  • caribbean
  • chinese
  • cuban
  • danish
  • dutch
  • eastern-european
  • egyptian
  • ethiopian
  • filipino
  • finnish
  • french
  • german
  • greek
  • hungarian
  • indian
  • indonesian
  • iranian
  • irish
  • israeli
  • italian
  • jamaican
  • japanese
  • korean
  • latin-american
  • lebanese
  • malaysian
  • mediterranean
  • mexican
  • middle-eastern
  • moroccan
  • norwegian
  • pakistani
  • peruvian
  • polish
  • portuguese
  • russian
  • scandinavian
  • southern-us
  • spanish
  • swedish
  • swiss
  • tex-mex
  • thai
  • turkish
  • vietnamese

Courses

  • appetizer
  • breakfast
  • brunch
  • dessert
  • dinner
  • drink
  • lunch
  • main-course
  • side-dish
  • snack

Diets

  • dairy-free
  • gluten-free
  • pescatarian
  • vegan
  • vegetarian

Allergens

The fourteen allergens EU food labelling must declare. These appear on a recipe's allergens field; there is no allergen filter.

  • celery
  • crustaceans
  • eggs
  • fish
  • gluten
  • lupin
  • milk
  • molluscs
  • mustard
  • peanuts
  • sesame
  • soy
  • sulphites
  • tree-nuts

Units

Every ingredient quantity carries one of these, or none at all — a bare number is a count of pieces. Source spellings are mapped onto them, so Swedish “msk” arrives as tbsp.

  • g
  • kg
  • lb
  • oz
  • cl
  • cup
  • dl
  • fl-oz
  • gallon
  • l
  • ml
  • pint
  • quart
  • tbsp
  • tsp
  • bag
  • bottle
  • box
  • bunch
  • can
  • clove
  • cube
  • dash
  • drop
  • handful
  • head
  • jar
  • leaf
  • package
  • piece
  • pinch
  • scoop
  • sheet
  • slice
  • sprig
  • stalk
  • stick

Categories and ingredients

Two filters are not closed lists.

  • category is a normalized slug from an open set — pasta, soup, bread. Read them off the categories field of recipes you already have.
  • ingredient is a canonical ingredient id such as chicken-thigh. GET /ingredients lists them, most used first.

Both must be slugs: lower-case letters, digits and single hyphens. Main Course is rejected; main-course is not.