The timely identification of individuals at high risk for peptic ulcers (PUs) is vital in preventing gastrointestinal bleeding after antiplatelet therapy. This study was designed to determine PU risk factors and develop a risk assessment model for PU detection in the general Chinese population. In a prospective dataset, clinical data from individuals undergoing gastroscopic evaluation between April 2019 and May 2022 were recorded. PUs were defined as mucosal defects exceeding 5 mm confirmed via gastroscopy. Participants were categorized into development (April 2019 to April 2021) and validation (May 2021 to May 2022) sets based on chronological order. LASSO-derived logistic regression analysis was employed to create a score, which was further validated via temporal validation. A total of 902 patients were ultimately enrolled, 204 (22.6%) of whom had PUs based on endoscopic findings. In the development cohort (n = 631), seven independent risk factors emerged: male sex (OR = 2.35, P = 0.002), white blood cell (WBC) count (OR = 1.16, P = 0.010), red blood cell (RBC) count (OR = 0.49, P < 0.001), globulin level (OR = 0.92, P = 0.004), albumin level (OR = 0.94, P = 0.020), pepsinogen I (PGI) level (OR = 1.01, P < 0.001), and positive Helicobacter pylori (HP) antibody (OR = 2.50, P < 0.001). Using these factors, a nomogram (HAMPROW score [hazard ratio (HP) antibody, albumin, male, PGI, RBC, globulin, and WBC]) was developed for individual PU prediction. The ability of the HAMPROW score to predict survival was confirmed with AUCs of 0.854 (95% CI 0.816–0.891) and 0.833 (95% CI 0.771–0.895) in the development and validation sets, respectively. In conclusion, the HAMPROW score can be used to screen for PUs effectively in the general Chinese population, facilitating personalized early detection of high risk of gastrointestinal bleeding before antiplatelet therapy.