The invention belongs to the technical field of medicines, and discloses application of cucurbitacin in the preparation of medicaments for treating cough. The cucurbitacin comprises cucurbitacin A, B, C, D, E, I, Q and S, dihydrocucurbitacin A, B, C, D, E, I, Q and S, isocucurbitacin A, B, C, D, E, I, Q and S, and one or more than two of glucoside substances corresponding to each cucurbitacin. The cucurbitacin can be prepared into tablets, capsules, granules, powder, suspensions, syrups, oral liquid, patch, ointment, aerosol, suppository, nose drops or injection and the like with a pharmaceutically-acceptable carrier, can be used for treating the cough caused by various reasons, and has the effect of eliminating phlegm. The dose of healthy adults is between 0.1 and 5 mg/d, and preferable is between 0.3 and 3 mg/d; and the dose of children is subjected to discretionary reduction.