Objectives. Ankylosing spondylitis (AS) is a chronic inflammatory rheumatic disease characterized by chronic spinal inflammation, arthritis, gut inflammation, and enthesitis. We aimed to identify the key biomarkers related to immune infiltration and osteoclast differentiation in the pathological process of AS by bioinformatic methods. Methods. GSE25101 from the Gene Expression Omnibus was used to obtain AS-associated microarray datasets. We performed bioinformatics analysis using R software to validate different expression levels. The purpose of the GO and KEGG enrichment analyses of DEGs was to exclude key genes. Using weighted correlation network analysis (WGCNA), we examined all expression profile data and identified differentially expressed genes. The objective was to investigate the interaction between genetic and clinical features and to identify the essential relationships underlying coexpression modules. The CIBERSORT method was used to make a comparison of the immune infiltration in whole blood between the AS group and the control group. The WGCNA R program from Bioconductor was used to identify hub genes. RNA extraction reverse transcription and quantitative polymerase chain reaction were conducted in the peripheral blood collected from six AS patients and six health volunteers matched by age and sex. Results. 125 DEGs were identified, consisting of 36 upregulated and 89 downregulated genes that are involved in the cell cycle and replication processes. In the WGCNA, modules of MCODE with different algorithms were used to find 33 key genes that were related to each other in a strong way. Immune infiltration analysis found that naive CD4+ T cells and monocytes may be involved in the process of AS. PLCG2 and IFNAR1 genes were obtained by screening genes meeting the conditions of immune cell infiltration and osteoclast differentiation in AS patients among IGF2R, GRN, SH2D1A, LILRB3, IFNAR1, PLCG2, and TNFRSF1B. The results demonstrated that the levels of PLCG2 mRNA expression in AS were considerably higher than those in healthy individuals (). IFNAR1 mRNA expression levels were considerably lower in AS than in healthy individuals (). Conclusions. Dysregulation of PLCG2 and IFNAR1 are key factors in disease occurrence and development of AS through regulating immune infiltration and osteoclast differentiation. Explaining the differences in immune infiltration and osteoclast differentiation between AS and normal samples will contribute to understanding the development of spondyloarthritis.