Food allergies occur when a harmful immune response is triggered by food. An immune response occurs when protein is triggered in the food and the reaction is allergic. A blood test or a skin test can be used to diagnose allergies. Peanuts, cow's milk, shellfish, eggs, and tree nuts such as walnuts, almonds, or cashews are the most common allergens. More than 170 foods have been linked to allergic reactions.