Methods and devices for the detection of food allergens using molecularly imprinted polymers that are imprinted for a target food allergen. A molecularly imprinted polymer may be imprinted using surface imprinting or other procedures. Detection of food allergens, such as peanut allergens, may be accomplished using all or a portion of a protein food allergen as a template to produce a molecularly imprinted polymer for food allergen detection. A portion utilized can be one that creates receptor sites in the molecularly imprinted polymer that are unique or more unique to the target food allergen than receptor sites that would be created if an entire food allergen molecule were utilized.