Astragaloside IV is the main active ingredient of Astragalus membranaceus. Studies have found that it can promote the proliferation of osteoblasts and can antagonize the apoptosis of mouse osteoblasts induced by hydrogen peroxide, but its molecular mechanism for the treatment of osteoporosis is still not clear. First, we used 3 online platforms: CTD, PharmMapper and SwissTargetPrediction to retrieve the targets of Astragaloside IV, and collected osteoporosis-related targets. Next, we used Cytoscape 3.7.2 software to construct a visual network diagram of PPI and further screened the key genes of Astragaloside IV in the treatment of osteoporosis using cluster analysis. Finally, after the receptor and ligand were docked, the binding activity was assessed by docking score. We obtained 102 overlapping targets of Astragaloside IV and osteoporosis. According to the node degree value in the PPI network, the top 10 genes were PIK3CA, MAPK1, SRC, STAT3, VEGFA, HSP90AA1, RELA, AKT1, IGF1, EGFR, of which SRC, AKT1, PIK3CA could bind stably to Astragaloside IV. KEGG pathway enrichment results showed that Astragaloside IV treated osteoporosis through 10 main pathways, including PI3K-Akt signaling pathway, FoxO signaling pathway, MAPK pathway, and so on. The classification of these pathways belongs to signal transduction, immune system, development and regeneration and endocrine system. Astragaloside IV is significantly related to several pathways involved in osteoporosis, such as PI3K-Akt, FoxO signaling pathway and MAPK pathway. SRC, AKT1, and PIK3CA can bind stably with Astragaloside IV, and they may be hub genes for the treatment of osteoporosis.