Abstract Background Endometriosis (EMs) is an enigmatic disease of yet-unknown pathogenesis. Disulfidptosis, a novel identified form of programmed cell death resulting from disulfide stress, stands a chance of treating diverse ailments. However, the potential roles of disulfidptosis-related genes (DRGs) in EMs remain elusive. This study aims to thoroughly explore the key disulfidptosis genes involved in EMs, and probe novel diagnostic markers and candidate therapeutic compounds from the aspect of disulfidptosis based on bioinformatics analysis, machine learning, and animal experiments. Results Enrichment analysis on key module genes and differentially expressed genes (DEGs) of eutopic and ectopic endometrial tissues in EMs suggested that EMs was closely related to disulfidptosis. And then, we obtained 20 and 16 disulfidptosis-related DEGs in eutopic and ectopic endometrial tissue, respectively. The protein-protein interaction (PPI) network revealed complex interactions between genes, and screened nine and ten hub genes in eutopic and ectopic endometrial tissue, respectively. Furthermore, immune infiltration analysis uncovered distinct differences in the immunocyte, human leukocyte antigen (HLA) gene set, and immune checkpoints in the eutopic and ectopic endometrial tissues when compared with health control. Besides, the hub genes mentioned above showed a close correlation with the immune microenvironment of EMs. Furthermore, four machine learning algorithms were applied to screen signature genes in eutopic and ectopic endometrial tissue, including the binary logistic regression (BLR), the least absolute shrinkage and selection operator (LASSO), the support vector machine-recursive feature elimination (SVM-RFE), and the extreme gradient boosting (XGBoost). Model training and hyperparameter tuning were implemented on 80% of the data using a ten-fold cross-validation method, and tested in the testing sets which determined the excellent diagnostic performance of these models by six indicators (Sensitivity, Specificity, Positive Predictive Value, Negative Predictive Value, Accuracy, and Area Under Curve). And seven eutopic signature genes (ACTB, GYS1, IQGAP1, MYH10, NUBPL, SLC7A11, TLN1) and five ectopic signature genes (CAPZB, CD2AP, MYH10, OXSM, PDLIM1) were finally identified based on machine learning. The independent validation dataset also showed high accuracy of the signature genes (IQGAP1, SLC7A11, CD2AP, MYH10, PDLIM1) in predicting EMs. Moreover, we screened 12 specific compounds for EMs based on ectopic signature genes and the pharmacological impact of tretinoin on signature genes was further verified in the ectopic lesion in the EMs murine model. Conclusion This study verified a close association between disulfidptosis and EMs based on bioinformatics analysis, machine learning, and animal experiments. Further investigation on the biological mechanism of disulfidptosis in EMs is anticipated to yield novel advancements for searching for potential diagnostic biomarkers and revolutionary therapeutic approaches in EMs.