The invention discloses a set of oligonucleotide aptamers Sp1 and Sp20 for specifically recognizing Sh.sonnei, belonging to the field of food safety molecular biology. The set of oligonucleotide aptamers Sp1 and Sp20 is prepared through the steps of through a Cell-SELEX technology, sequentially carrying out screening, amplifying, enzyme digestion, sequencing, and affinity and specificity analysis on a random single stranded oligonucleotide library synthesized in vitro by taking a complete Sh.sonnei cell as a target. The aptamers adopted by screening have the characteristics of high affinity and specificity, stable properties, low cost, and the like, is convenient for vitro synthesis and can be applied to the detection of Sh.sonnei in foods by marking functional groups or fluorescent dyes, thereby providing a new choice for existing antibody-dependent detection methods.