Objective. The aim of the study was to explore the potential mechanism of Zanthoxylum bungeanum in the treatment of diabetes mellitus (DM) using network pharmacology. Methods. The DrugBank database and TCMSP platform were used to search for the main chemical components and their targets of Zanthoxylum bungeanum, and the genes related to diabetes mellitus were obtained from the genecards database. Import the data into the Venny 2.1.0 platform for intersection analysis to obtain the Zanthoxylum bungeanum-DM-gene dataset. The protein-protein interaction (PPI) analysis of Zanthoxylum bungeanum-DM gene was performed using the String data platform, and the visualization and network topology analysis were performed using Cytoscape 3.8.2. The KEGG pathway enrichment and biological process of GO enrichment analysis were carried out using the David platform. The active ingredients and key targets of Zanthoxylum bungeanum were molecularly docked to verify their biological activities by using Discovery Studio 2019 software. Zanthoxylum bungeanum was extracted and isolated by ethanol and dichloromethane. HepG2 cells were cultured, and cell viability assay was utilized to choose the suitable concentration of Zanthoxylum bungeanum extract (ZBE). The western blot assay was used for measuring the expression of AKT1, IL6, HSP90AA1, FOS, and JUN proteins in HepG2 cells. Results. A total of 5 main compounds, 339 targets, and 16656 disease genes were obtained and retrieved, respectively. A total of 187 common genes were screened, and 20 core genes were finally obtained after further screening. The antidiabetic active ingredients of Zanthoxylum bungeanum are kokusaginin, skimmianin, diosmetin, beta-sitosterol, and quercetin, respectively. The main targets for its antidiabetic effect are AKT1, IL6, HSP90AA1, FOS, and JUN, respectively. GO enrichment analysis revealed that the biological process of Zanthoxylum bungeanum and DM is related to a positive regulation of gene expression, positive regulation of transcription, positive regulation of transcription from RNA polymerase II promoter, response to drug, positive regulation of apoptotic process, and positive regulation of cell proliferation, etc. KEGG enrichment analysis revealed that common biological pathways mainly including the phospholipase D signaling pathway, MAPK signaling pathway, beta-alanine metabolism, estrogen signaling pathway, PPAR signaling pathway, and TNF signaling pathway. Molecular docking results showed that AKT1 with beta-sitosterol and quercetin, IL-6 with diosmetin and skimmianin, HSP90AA1 with diosmetin and quercetin, FOS with beta-sitosterol and quercetin, and JUN with beta-sitosterol and diosmetin have relatively strong binding activity, respectively. Experiment verification results showed that DM could be significantly improved by downregulating the expression of AKT1, IL6, HSP90AA1, FOS, and JUN proteins after being treated at concentrations of 20 μmol/L and 40 μmol/L of ZBE. Conclusion. The active components of Zanthoxylum bungeanum mainly including kokusaginin, skimmianin, diosmetin, beta-sitosterol, and quercetin. The therapeutic effect of Zanthoxylum bungeanum on DM may be achieved by downregulating core target genes including AKT1, IL6, HSP90AA1, FOS, and JUN, respectively. Zanthoxylum bungeanum is an effective drug in treatment of DM related to the above targets.