Coronary heart disease (CHD) is a significant cardiovascular condition characterized by a complex pathological process involving increased oxidative stress and cardiomyocyte apoptosis. Stachyose, a naturally occurring functional food additive, has the potential to provide therapeutic benefits against this pathological condition. Our study aimed to explore the underlying mechanisms by which stachyose exerts its protective effects on CHD by employing network pharmacology and transcriptomics, with validation both in vivo and in vitro. The results demonstrated that stachyose reduced hemorheological abnormalities and blood coagulation, modulated platelet activation in CHD rats, contributed to ameliorating myocardial injury, and decreased myocardial apoptosis. Notably, stachyose alleviated oxidative stress -induced injury and apoptosis in DOX-treated H9c2 cells. Integrated network pharmacology and transcriptomic analyses revealed that stachyose treated CHD by modulating the P53 and FOXO1 signaling pathways and reducing the expression of apoptosis-related proteins. Furthermore, the involvement of these pathways was confirmed using both a P53 activator and inhibitor. Our study initially showed that stachyose inhibits cardiomyocyte apoptosis by regulating the P53 and FOXO1 signaling pathways, suggesting that could serve as a potential therapeutic option for CHD.