Abstract Osteoarthritis (OA) is a global problem that seriously affects human health. At present, there is still a lack of effective drugs to treat OA. Therefore, we need to find more drugs with preventive and therapeutic effects on OA. In this study, we obtained single-cell RNA sequencing (scRNA-seq) and bulk-RNA seq datasets from Gene Expression Omnibus (GEO). By using high-dimensional weighted correlation network analysis (hdWGCNA), random forest method and protein–protein interaction (PPI) network analyses, five key genes (CXCL8, CCL20, MMP3, BIRC3 and ICAM1) related to OA were identified and the RT-qPCR experiments verified the differential expression of CXCL8, CCL20 and BIRC3 between Triclocarban (TCC) treated zebrafishes and controls. The SAVERUNNER algorithm predicted 42 candidate drugs. Mendelian randomization (MR) of the candidate drugs showed that the increased expression of TUBB1 led to a reduced risk of OA (β = -0.08, P -value = 4.56E-04), while Cabazitaxel (a microtubule dynamics inhibitor commonly used in the treatment of advanced prostate cancer) inhibits the expression of TUBB1, thus increases the risk of OA. Pitavastatin (a statin lipid-lowering drug that can reduce blood lipid levels and the risk of cardiovascular diseases) target genes expression (for HMGCR $$\upbeta$$ = 0.13, P -value = 2.67E-06, for ITGAL $$\upbeta$$ = 0.08, P -value = 6.57E-08) leads to an increased risk of OA, while Pitavastatin inhibits the expression of target genes, thus reduces risk of OA. The zebrafish experiments showed that Pitavastatin can increase the joint space of TCC treated OA zebrafish, while Cabazitaxel can decrease the joint space of TCC treated OA zebrafish. The RT-qPCR results of zebrafish verified that Pitavastatin inhibited the expression of HMGCR, while Cabazitaxel inhibited the expression of TUBB1. Our study suggested that Pitavastatin has therapeutic effects on OA, while Cabazitaxel increases the risk of OA.