Since the sensitivity and accuracy of traditional detection for early gastric cancer diagnosis are still insufficient, it is significant to continuously optimize the optical molecular imaging detection technology based on an endoscopic platform. The signal intensity and stability of traditional chemical fluorescent dyes are low, which hinders the clinical application of molecular imaging detection technology. This work developed a probe based on perovskite quantum dots (PQDs) and peptide ligands. By utilizing CsPbBr3perovskite PQDs modified by azithromycin (AZI), combined with the specific polypeptide ligand of CD44v6, a gastric cancer biomarker, the perovskite-based probe (AZI-PQDs probe) which can specifically identify gastric cancer tumor was prepared. Owing to the high photoluminescence quantum yield of CsPbBr3PQDs, the naked eye can observe the imaging under the excitation of the hand-held ultraviolet light source. AZI-PQDs probe can accurately identify gastric cancer cells, tissues, and xenograft models with experiments ofex vivoandin vivofluorescence imaging detection. It also exhibited low toxicity and immunogenicity, indicating the safety of the probe. This work provides a probe combined with cancer specificity and a reliable fluorescent signal that has the potential for application in gastric cancer optical molecular imaging.