Background:Endometrial cancer (UCEC) is a commonly occurring tumor in females, and polycystic ovary syndrome (PCOS) is closely related to UCEC, but the molecular mechanisms remain unclear. This article aims to explore potential molecular mechanisms in UCEC and PCOS, as well as identify prognostic genes for UCEC.Methods:Bioinformatics methods were employed to screen for DEGs in UCEC and PCOS. The shared DEGs were analyzed by constructing a protein-protein interaction (PPI) network using the String database and Cytoscape software. The enrichment analysis was performed using Metascape. The shared DEGs associated with the prognosis of UCEC were identified through univariate and lasso Cox regression methods. A multivariate Cox regression model was constructed and internally validated. The expression and test efficiency of the key prognostic genes were verified using external datasets for UCEC and PCOS. Furthermore, the Gepia database was utilized to analyze the expression of key prognostic genes and their correlation with the disease-free survival (RFS) of UCEC. Tumor mutation burden (TMB), immune infiltration, and the correlation of immune cells were assessed for the prognostic genes of UCEC.Results:There were 151 shared DEGs identified between UCEC and PCOS through bioinformatics screening. These shared DEGs were primarily enriched in leukocyte activation. Following model construction and verification, nine genes were determined to be prognostic for UCEC from the shared DEGs. Among them, TSPYL5, KCNJ15, RTN1, HMOX1, DCAF12L1, VNN2, and ANXA1 were confirmed as prognostic genes in UCEC through external validation. Additionally, RTN1 was identified as a key gene in both UCEC and PCOS. Gepia analysis revealed that higher expression of RTN1 was associated with RFS in UCEC. Immune infiltration analysis of the shared DEGs demonstrated significant differences in the expression of various immune cells between UCEC high and low TMB groups. The seven key prognostic genes in UCEC exhibited regulatory relationships with immune cells.Conclusion:This study identified TSPYL5, KCNJ15, RTN1, HMOX1, DCAF12L1, VNN2, and ANXA1 as the key prognostic DEGs of UCEC. These genes are associated with UCEC survival, TMB, immune cell infiltration, and immune cell regulation. Among them, RTN1 may serve as a potential biomarker for both UCEC and PCOS.