BackgroundDiabetic retinopathy (DR) is considered one of the most severe complications of diabetes mellitus, but its pathogenesis is still unclear. We hypothesize that certain genes exert a pivotal influence on the progression of DR. This study explored biomarkers for the diagnosis and treatment of DR through bioinformatics analysis.MethodsWithin the GSE221521 and GSE189005 datasets, candidate genes were acquired from intersections of genes obtained using WGCNA and DESeq2 packages. Mendelian randomization (MR) analysis selected candidate biomarkers exhibiting causal relationships with DR. Receiver Operating Characteristic (ROC) analysis determined the diagnostic efficacy of biomarkers, the expression levels of biomarkers were verified in the GSE221521 and GSE189005 datasets, and a nomogram for diagnosing DR was constructed. Enrichment analysis delineated the roles and pathways associated with the biomarkers. Immune infiltration analysis analyzed the differences in immune cells between DR and control groups. The miRNet and networkanalyst databases were then used to predict the transcription factors (TFs) and miRNAs, respectively, of biomarkers. Finally, RT-qPCR was used to verify the expression of the biomarkers in vitro.ResultsMR analysis identified 13 candidate biomarkers that had causal relationships with DR. The ROC curve demonstrated favorable diagnostic performance of three biomarkers (OSER1, HIPK2, and DDRGK1) for DR, and their expression trends were consistent across GSE221521 and GSE189005 datasets. The calibration curves and ROC curves indicated good predictive performance of the nomogram. The biomarkers were enriched in pathways of immune, cancer, amino acid metabolism, and oxidative phosphorylation. Ten immune cell lines showed notable disparities between the DR and control groups. Among them, effector memory CD8+ T cells, plasmacytoid dendritic cells, and activated CD4+ T cells exhibited good correlation with biomarker expression. The TF-mRNA-miRNA network suggested that hsa-mir-92a-3p, GATA2, and RELA play important roles in biomarker targeting for DR. RT-qPCR results also demonstrated a notably high expression of HIPK2 in patients with DR, whereas notably low expression of OSER1.ConclusionOSER1, HIPK2, and DDRGK1 were identified as biomarkers for DR. The study findings provide novel insights into the pathogenesis of DR.