Recipe - Food - Nutrition

פרמיום
Verified
על ידי David | מְעוּדכָּן il y a 25 jours | Food
פּוֹפּוּלָרִיוּת

9.9 / 10

חֶבִיוֹן

1,479ms

רמת שירות

100%

Health Check

N/A

חזרה לכל הדיונים

Find by Nutrients not showing the correct results

Rapid account: Gaianilu
gaianilu
il y a 8 ans

If I send this request
https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByIngredients?fillIngredients=false&ingredients=apples%2Cflour%2Csugar&limitLicense=false&number=5&ranking=1
almost all results are way out of the ranges I set in the request. Am I misinterpreting the results?

Rapid account: Spoonacular
spoonacular Commented il y a 8 ans

Hi,

so the problem is that mashape did not use the correct camel casing. Please change in your request “minfat” to “minFat” and “mincarbs” to “minCarbs” etc. (also for calories and protein, min and max). I changed that again in mashape now, hope this time it sticks.

Also I added offset and limit parameters for paging.

Rapid account: Gaianilu
gaianilu Commented il y a 8 ans

Also, in the same request findByNutrients is there a way to show more than the default 10 results? Now I’m only getting 10 random recipes while I would like to iterate over all the set of recipes which should be returned.

Rapid account: Gaianilu
gaianilu Commented il y a 8 ans

For example with this request
https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/findByNutrients?maxcalories=250&maxcarbs=100&maxfat=20&maxprotein=100&mincalories=0&minCarbs=0&minfat=5&minProtein=0

I get recipes like
{
“id”: 167278,
“title”: “Double-Chocolate Cappuccino Cocoa”,
“image”: “https://spoonacular.com/recipeImages/Double-Chocolate-Cappuccino-Cocoa-167278.jpg”,
“imageType”: “jpg”,
“calories”: 394,
“protein”: “11g”,
“fat”: “25g”,
“carbs”: “36g”
}

where both calories and fat are out of the bounds I set. Almost all the results are like this.

Rapid account: Spoonacular
spoonacular Commented il y a 8 ans

Hey Gaianilu,

I checked the request but could not understand what the problem you are having is. Could you please clarify?

Rapid account: Spoonacular
spoonacular Commented il y a 8 ans

sorry for the delay, I will look into this issue shortly

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות