Ziziphi Spinosae Semen (ZSS) has been widely used in traditional Chinese medicine system for decades. Under proper humidity and temperature, ZSS is easily contaminated by fungi and mycotoxins during harvest, storage, and transport, thereby posing a considerable threat to consumer health. In this study, we first used the Illumina MiSeq PE250 platform and targeted the internal transcribed spacer 2 sequences to investigate the presence of fungi in moldy and normal ZSS samples collected from five producing areas in China. Results showed that all 14 samples tested were contaminated by fungi. Ascomycota was the dominant fungus at the phylum level, accounting for 64.36–99.74% of the fungal reads. At the genus level, Aspergillus, Candida, and Wallemia were the most predominant genera, with the relative abundances of 13.52–87.87%, 0.42–64.56%, and 0.06–34.31%, respectively. Meanwhile, 70 fungal taxa were identified at the species level. Among these taxa, three potential mycotoxin-producing fungi, namely, Aspergillus
flavus, A. fumigatus, and Penicillium citrinum that account for 0.30–36.29%, 0.04–7.37%, and 0.01–0.80% of the fungal reads, respectively, were detected in all ZSS samples. Moreover, significant differences in fungal communities were observed in the moldy and normal ZSS samples. In conclusion, our results indicated that amplicon sequencing is feasible for the detection and analysis of the fungal community in the ZSS samples. This study used a new approach to survey the fungal contamination in herbal materials. This new approach can provide early warning for mycotoxin contamination in herbal materials, thereby ensuring drug efficacy and safety.