Recipe - Food - Nutrition

免费增值
Verified
通过 David | 已更新 לפני 25 ימים | Food
人气

9.9 / 10

延迟

1,479ms

服务等级

100%

Health Check

N/A

返回所有讨论

Find by Nutrients not showing the correct results

Rapid account: Gaianilu
gaianilu
לפני 8 שנים

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 לפני 8 שנים

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 לפני 8 שנים

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 לפני 8 שנים

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 לפני 8 שנים

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 לפני 8 שנים

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

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论