The invention discloses a method for analyzing the analgesic effect of active ingredients of nux vomica based on network pharmacology. The method comprises the following steps: S1, obtaining chemicalcomponents and component action targets of nux vomica, wherein nux vomica is used as a keyword, and retrieving is performed by utilizing a BATMAN-TCM database to obtain a nux vomica active compound meeting conditions and a targeting gene thereof; S2, identifying a disease action target, wherein a virtual target gene related to pain is acquired by using a DisGeNET database, and intersection is performed on the nux vomica active compound and the target gene thereof to obtain a drug-disease intersection target gene; S3, constructing a nux vomica and disease network, and screening a core node; andS4, performing GO enrichment and KEGG pathway annotation analysis on the core node by using the DAVID, predicting target function distribution, analyzing the enrichment degree of the core pathway according to the enrichment factor, and analyzing the nux vomica analgesic action mechanism. With the method, the problems of long nux vomica research period, lack of systematicness, single research target and the like at present are solved.