The misuse of antitussives preparations is a continuing problem in the world, and imply that they might have potential new psychoactive substances (NPS) activity. However, few study focus on their ecological toxicity towards fish. In the present study, the machine learning (ML) methods gcForest and random forest (RF) were employed to predict NPS activity in 30 antitussives. The potential toxic target, mode of action (MOA), acute toxicity and chronic toxicity to fish were further investigated. The results showed that both gcForest and RF achieved optimal performance when utilizing combined features of molecular fingerprint (MF) and molecular descriptor (MD), with area under the curve (AUC) = 0.99, accuracy >0.94 and f1 score > 0.94, and were applied to screen the NPS activity in antitussives. A total of 15 antitussives exhibited potential NPS activity, including frequently-used substances like codeine and dextromethorphan. The binding affinity of these antitussives with zebrafish dopamine transporter (zDAT) was high, and even surpassing that of some traditional narcotics and NPS. Some antitussives formed hydrogen bonds or salt bridges with aspartate (Asp) 95, tyrosine (Tyr) 171 of zDAT. For the ecotoxicity, the MOA of these 15 antitussives in fish was predicted as narcosis. The prenoxdiazin, pholcodine, codeine, dextromethorphan and dextrorphan exhibited very toxic/toxic to fish. It was necessary to pay close attention to the ecotoxicity of these antitussives. In this study, the integration of ML, molecular docking and ECOSAR approaches are powerful tools for understanding the toxicity profiles and ecological hazards posed by new pollutants.