Ischemic stroke (IS) is a complex syndrome of neurological deficits due to stenosis or occlusion of the carotid and vertebral arteries for which there is still no effective treatment. Melatonin, a hormone secreted by the pineal gland, has multiple biological effects, such as antioxidant and anti-inflammatory properties, circadian rhythm regulation, and tissue regeneration, demonstrating potential applications in the treatment of IS. The aim of this study was to investigate key melatonin-regulated genes associated with IS using transcriptome sequencing and bioinformatics analyses and to explore their potential mechanisms of action in the disease process. We obtained gene expression data related to ischemic stroke (IS) from the Gene Expression Omnibus (GEO) database and identified candidate genes using machine learning algorithms. We then assessed the predictive power of these genes using PPI network analysis and diagnostic models. Finally, a series of enrichment analyses identified four key genes: ADM, PTGS2, MMP9, and VCAN. In addition, we determined the mRNA levels of these four key genes in an IS rat model using qPCR and found that all of these genes were significantly upregulated in the IS model compared to the control group, which is consistent with the results of previous analyses. Meanwhile, these genes have biological functions such as regulating vascular tone, participating in the inflammatory response, influencing tissue remodeling, and regulating cell adhesion and proliferation, playing key roles in the pathogenesis of IS. Therefore, we suggest that these four key genes may serve as prospective biomarkers for IS and help predict the risk of developing IS. In conclusion, this study elucidates for the first time the potential role of melatonin in the pathogenesis of IS and lays the foundation for in-depth studies on the functions of these key genes in the pathophysiology of IS and their potential applications in clinical diagnosis and treatment.