To explore immune-related molecules that affect the prognosis of endometrial carcinoma (EC) using bioinformatic data mining. The expression data related to EC were downloaded from The Cancer Genome Atlas (TCGA) and Gene Expression Omnibus databases. After differential expression analysis, the intersection with immune related genes in the ImmPort database was used to obtain immune related differentially expressed genes (IRDEGs). The correlation between clinicopathological information and the prognosis of IRDEGs was further analyzed to obtain prognosis related differentially expressed immune genes (PRDEIG). Gene correlation analysis and Gene Set Enrichment Analysis (GSEA) enrichment analysis showed that PRDEIG was enriched in cancer-related functional pathways. We then analyzed the relationship between PRDEIG and immune cell infiltration, and further analyzed the mRNA and protein expression of PRDEIG in EC using TCGA and the human protein expression atlas (THPA) databases. After the intersection of the differential expression analysis results and immune-related genes, 4 IRDEGs were obtained: osteoglycin (OGN), LTBP4, CXCL12, and SPP1. After analyzing the relationship between 4 IRDEGs and clinicopathological parameters and prognosis of patients with EC, revealed that only OGN was not only related to tumor immunity, but also affected the prognosis of patients with EC. Gene correlation and GSEA enrichment of OGN were analyzed. The results showed that OGN was significantly enriched in 6 functional pathways: epithelial mesenchymal transition, KRAS signaling up, myogenesis, UV response, allograft rejection and apical junction. In addition, it was also found that OGN was significantly correlated with a variety of immune cells. The results of TCGA and THPA database showed that the mRNA and protein expression levels of OGN decreased in EC. OGN may affect the epithelial mesenchymal transformation (EMT) of tumor by affecting the infiltration of tumor immune cells.