Fat intake is among the most significant triggers for symptom development in patients with irritable bowel syndrome (IBS). Nevertheless, long-term restriction in fatty foods ingestion may lead to nutritional inadequacies. This study aimed to identify the crucial genes involved in lipid-induced gastrointestinal symptoms, contributing to helping IBS patients regulate fat. The clinical characteristics of the subjects were collected by questionnaire investigation and analyzed using multivariate logistic regression. Differentially expressed genes (DEG) and signaling pathways were analyzed by Gene Ontology and Kyoto Encyclopedia of Genes and Genomes pathway enrichment analysis. ImmuInfiltration and CIBERSORT packages evaluated small intestine immune cell infiltration. Random forest and SVM-RFE algorithms were used to select hub genes. A receiver operating characteristic curve was used to access the diagnostic significance of each hub gene. Gene Set Enrichment Analysis (GSEA) was performed to identify hub genes’ molecular processes in IBS development after lipid infusion. IBS patients’ risk, severity, and quality of life increased with fat intake. In total, 116 robust DEGs were identified in IBS patients after lipid infusion using the GSE166869 dataset and were mainly clustered in the immune and inflammatory pathways. IBS patients had greater Neutrophils, CD4+ T cells, and M1 Macrophages than healthy controls. Furthermore, infiltration levels of Neutrophils and resting memory CD4+ T cells were inversely related to the expression of hub genes (IGKV1D-43, IGKV1-12, APOD, FCGR2A and IGKV2-29). After lipid infusion, GSEA results of each hub gene indicated the relevance of proinflammatory pathways in IBS pathogenesis. After verification, only APOD and FCGR2A were stably downregulated in small intestinal mucosa and plasma of IBS patients. The area under the curve of APOD combined with FCGR2A expression was 0.9. APOD and FCGR2A may be promising biomarkers for IBS diagnosis and lipid-sensitive IBS patients. Their potential roles in the immune microenvironment of the small intestinal mucosa may provide a vital clue to IBS precision therapy.