IntroductionCocaine is a highly addictive drug that is abused due to its excitatory effect on the central nervous system. It is critical to reveal the mechanisms of cocaine addiction and identify key genes that play an important role in addiction.MethodsIn this study, we proposed a centrality algorithm integration strategy to identify key genes in a protein–protein interaction (PPI) network constructed by deferential genes from cocaine addiction-related datasets. In order to investigate potential therapeutic drugs for cocaine addiction, a network of targeted relationships between nervous system drugs and key genes was established.ResultsFour key genes (JUN, FOS, EGR1, and IL6) were identified and well validated using CTD database correlation analysis, text mining, independent dataset analysis, and enrichment analysis methods, and they might serve as biomarkers of cocaine addiction. A total of seventeen drugs have been identified from the network of targeted relationships between nervous system drugs and key genes, of which five (disulfiram, cannabidiol, dextroamphetamine, diazepam, and melatonin) have been shown in the literature to play a role in the treatment of cocaine addiction.DiscussionThis study identified key genes and potential therapeutic drugs for cocaine addiction, which provided new ideas for the research of the mechanism of cocaine addiction.