Sign in | Sign up

Search Results


Currently contains 14 posts


May 14, 2013 17:50


I’m using the demo api call in the documentation and I seem to be getting some odd results back. For example, I searched for “dinner roll” and the first result is “item_name”: “Rolo Chewy Caramels in Milk Chocolate”, which seems odd.


May 14, 2013 19:28

Matt Silverman

That is definitely not an ideal result for that search. We are constantly tweaking how our search algorithm works, and I am going to add a ticket for this. We will aim to have it fixed in the next week.


May 18, 2013 20:44


It seems that the search also looks at the brand by default, so if I look for “chicken”, I’ll get results from Kentucky Fried Chicken and Church’s Chicken – even if the word chicken isn’t in the food item. So I’m searching for chicken, and getting back results for soft drinks among my other foods, since those restaurants — well, you get the idea.

Same goes for “burger” and “Burger King”, “Smashburger”, etc. “Taco” has the same problem, but only if I go past the first few hundred results.


May 20, 2013 19:46


Is there anyway to make the api search only on food name? The current bias towards brands is making the results rather unhelpful. The best I could do to make the results somewhat better is to limit the search to only look at the USDA brand.

May 20, 2013 20:42

Anonymous User

As Matt stated above we are constantly improving our search functionality. Version 1.1 of the api is available but in beta right now, once we have finished some additional tweaks this will become production ready.

We will look into adding a flag so you can avoid searching on brand name.


June 28, 2013 11:15


Is there anyway to retrieve all fields in the result without having to list individual fields to return in the call?

June 28, 2013 14:10

Anonymous User


That should return all fields in search.


July 21, 2013 15:37


I found a bug in the JSON formatting of the search results. If the nf_ingredient_statement is not null, there are two extra CRLFs in value field, on e at the start and the other at the end of the ingredient list.
“_index”: “n456rtq6646r00zma1iq”,
“_type”: “item”,
“_id”: “51c35d5597c3e69de4b00e3f”,
“_score”: 2.6308265,
“fields”: {
“old_api_id”: null,
“item_id”: “51c35d5597c3e69de4b00e3f”,
“item_name”: “Taco Dinner”,
“upc”: 11225037115,
“brand_id”: “51db37cb176fe9790a89993c”,
“brand_name”: “World Classics”,
“item_description”: "",
“updated_at”: “Mon Jul 08 2013 17:00:30 GMT-0700 (PDT)”,
“nf_ingredient_statement”: "
Taco Shells: Stone Ground Corn Flour, Coconut and/or Soybean Oil, Water, Iron, Niacin, Thiamine, Riboflavin, Folic Acid, Lime. Taco Sauce: Tomato, Water, Green Chili, Tomato Paste, Onion, Jalapeno Peppers, Salt, Potato Starch, Garlic, Vinegar. Taco Seasoning Mix: Dehydrated Onion, Maltodextrin, Salt, Chili Peppers, Paprika, Potato Flour, Spices, Dehydrated Garlic, Cocoa and Citric Acid.
“nf_water_grams”: null,
“nf_calories”: 150,
“nf_calories_from_fat”: 60,
“nf_total_fat”: 6,
“nf_saturated_fat”: 5,
“nf_trans_fatty_acid”: 0,
“nf_polyunsaturated_fat”: null,
“nf_monounsaturated_fat”: null,
“nf_cholesterol”: 0,
“nf_sodium”: 10,
“nf_total_carbohydrate”: 21,
“nf_dietary_fiber”: 2,
“nf_sugars”: 0,
“nf_protein”: 2,
“nf_vitamin_a_dv”: 0,
“nf_vitamin_c_dv”: 0,
“nf_calcium_dv”: 4,
“nf_iron_dv”: 10,
“nf_refuse_pct”: null,
“nf_servings_per_container”: 4,
“nf_serving_size_qty”: 3,
“nf_serving_size_unit”: “shells”,
“nf_serving_weight_grams”: null


September 13, 2013 01:16


“_score”? What value does it represent? Thanks.

September 13, 2013 02:09

Anonymous User

The _score field represents the calculated rating of the document. This is generated by the number of terms that match from your search query, and how many times they appear in an items name or any other field that we query.

September 13, 2013 02:19

Anonymous User

As for the JSON formatting. I pushed that JSON through a linter. It is correctly formatted. So if you are having an issue, it must be with the JSON parsing library that you are using.


September 13, 2013 14:04

Matt Silverman

@randytayler — We agree that there should be a way to run a search query and disregard the brand name matching. That is a good idea. We are researching this now, and will post an update when we have that functionality. Thanks for the suggestion!


November 12, 2014 20:22



this thread is one year old but there is still the issue that “item_name” gets also used for “brand_name” when “brand_name” is empty.

Is there a solution in sight?

Best regards


December 21, 2017 13:09



i want to search brand name and item name like (kfc chicken burger)

i know its possible to

“item_name”:“Chicken burger”,

but problem is my search text include both brand name and item name like *chicken burger kfc * then how can i identify which one is brand name or item name then pass in query. Plz help me.


Reply to thread