1

When I try just a few items such as

WolframAlpha["1 whole wheat tortilla + 2 slices american cheese + 150 g steak + 2 tbsp beans + 150 g white rice"]

I get the following nutrition facts table:

enter image description here

However, when I enter a longer query such as

WolframAlpha["1 whole wheat tortilla + 2 slices american cheese + 150 g steak + 2 tbsp beans + 150 g white rice + 100g bell peppers + 200 g chicken breast + 2 slices of whole wheat bread"]

I don't actually get a nutrition facts chart as before. Is there a way to force a nutrition facts output every time? Also, is there a way to limit the output pods to only a nutrition facts table, as I don't need any of the other pods?

cartonn
  • 1,005
  • 6
  • 15

2 Answers2

3

To get just the nutrition facts for simpler data use:

WolframAlpha["1 whole wheat tortilla + 2 slices american cheese + 150 g steak",
{{"NutritionLabelMultiplePlus", 1}, "Content"}]

To understand how to get this code use this answer as guide.

That other 2nd entry is so complex and long it throws something off in formatting. You can send feedback to Wolfram about it.

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
  • Feedback for Wolfram|Alpha should be sent to info@wolframalpha.com – chuy Sep 05 '13 at 18:31
  • If you can figure out a way to use this, and include TimeConstraint, that'd be the ideal solution. I tried WolframAlpha[query, {{"NutritionLabelMultiplePlus", 1}, "Content"}, TimeConstraint -> 600], but that doesn't work. – cartonn Sep 06 '13 at 00:36
1

The longer query is timing out. Set TimeConstraint option to larger value to enable completion. Use IncludePods->"NutritionLabelMultiplePlus" option setting to limit output content.

query1 = "1 whole wheat tortilla + 2 slices american cheese + 150 g steak + 2 tbsp beans + 150 g white rice";

query2 = query1 <> 
   " + 100 g bell peppers + 200 g chicken breast + 2 slices of whole wheat bread";

WolframAlpha[query1, IncludePods -> "NutritionLabelMultiplePlus"]

WolframAlpha[query2, IncludePods -> "NutritionLabelMultiplePlus", 
 TimeConstraint -> 60]
Verbeia
  • 34,233
  • 9
  • 109
  • 224
Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
  • 1
    Increasing TimeConstraint did not work for me for longer query, - pod was simply not returned. Did it work for you? – Vitaliy Kaurov Sep 05 '13 at 06:11
  • Yes it worked for me. Perhaps you need even more time with your internet connection. – Bob Hanlon Sep 05 '13 at 13:49
  • This also didn't work for me. Using your code results in the following message: "Wolfram|Alpha doesn't know how to interpret your input." – cartonn Sep 06 '13 at 00:31