Recipe - Food - Nutrition

FREEMIUM
Verified
By David | Updated 13 days ago | Food
Popularity

9.9 / 10

Latency

485ms

Service Level

100%

Health Check

N/A

Back to All Discussions

How to pass ingredientList to /visualizeNutrition/ API endpoint

Rapid account: Dapicester
dapicester
7 years ago

Hi,
today I started using your API, and I have a problem with the visualizeNutrition endpoint.
If I try the example on Mashape:

curl -X POST --include 'https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/visualizeIngredients' \
  -H 'X-Mashape-Key: foobarbaz' \
  -H 'Accept: text/html' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'defaultCss=true' \
  -d 'ingredientList=3 oz flour' \
  -d 'measure=metric' \
  -d 'servings=2' \
  -d 'showBacklink=true' \
  -d 'view=grid'

it works fine, but as you see there is only one ingredient.

The documentation says:

The ingredient list of the recipe, one ingredient per line.

So I did try in many different ways but non of them actually worked:

  1. -d 'ingredientList=3 oz flour' -d 'ingredientList=1 cup skimmed butter'
  2. -d 'ingredientList[]=3 oz flour' -d 'ingredientList[]=1 cup skimmed butter'
  3. -d 'ingredientList=1cup lard^M1 kg of chicken breast'
  4. -d 'ingredientList=1 cup lard\n1 kg of chicken breast'
  5. -d $'ingredientList=1cup lard\n1 kg of chicken breast'

So here is the question in the title: how do I pass a list of ingredients into ingredientList?

Rapid account: Spoonacular
spoonacular Commented 7 years ago

Number 4 works for me though.

Join in the discussion - add comment below:

Login / Signup to post new comments