Background Acute myocardial infarction (AMI), a subset of acute coronary syndrome, remains the major cause of mortality worldwide. Mitochondrial dysfunction is critically involved in AMI progression, and mitophagy plays a vital role in eliminating damaged mitochondria. This study aimed to explore mitophagy-related biomarkers and their potential molecular basis in AMI.Methods AMI datasets (GSE24519 and GSE34198) from the Gene Expression Omnibus database were combined and the batch effects were removed. Differentially expressed genes (DEGs) in AMI were selected, intersected with mitophagy-related genes for mitophagy-related DEGs (MRDEGs), and then subjected to enrichment analyses. Next, the MRDEGs were screened using machine learning methods (logistic regression analysis, RandomForest, least absolute shrinkage and selection operator) to construct a diagnostic risk model and select the key genes in AMI. The diagnostic efficacy of the model was evaluated using a nomogram. Moreover, the infiltration patterns of different immune cells in two risk groups were compared. We also explored the interactions between the key genes themselves or with miRNAs/transcription factors (TFs) and drug compounds and visualized the protein structure of the key genes. Finally, we explored and validated the expression of key genes in plasma samples of patients with an AMI and healthy individuals.Results We screened 28 MRDEGs in AMI. Based on machine learning methods, 12 key genes were screened for the diagnostic risk model, including AGPS, CA2, CAT, LTA4H, MYO9B, PRDX6, PYGB, SIRT3, TFEB, TOM1, UBA52, and UBB. The nomogram further revealed the accuracy of the model for AMI diagnosis. Moreover, we found a lower abundance of immune cells such as gamma delta T and natural killer cells in the high-risk group, and the expression of key genes showed a significant correlation with immune infiltration levels in both groups. Finally, 64 miRNA-mRNA pairs, 75 TF-mRNA pairs, 119 RNA-binding protein-mRNA pairs, and 32 drug-mRNA pairs were obtained in the interaction networks.Conclusions In total, 12 key MRDEGs were identified and a risk model was constructed for AMI diagnosis. The findings of this study might provide novel biomarkers for improving the detection of AMI.