Recipe - Food - Nutrition

FREEMIUM
Verified
Par David | Mise à jour 23日前 | Food
Popularité

9.9 / 10

Latence

518ms

Niveau de service

100%

Health Check

N/A

Retour à toutes les discussions

How to pass ingredientList to /visualizeNutrition/ API endpoint

Rapid account: Dapicester
dapicester
7年前

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年前

Number 4 works for me though.

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires