INTRODUCTION: Ruminants including goats have diverse microcosms of microbiota involved in diet digestion, absorption, and assimilation. Moreover, it is well known that changes in dietary regimens including nutrient levels result in varied gut microbiota composition, and ultimately, the performance and health of these animals. METHODS: The current study examined the effects of varying dietary energy and protein levels on the cecal fermentation, immune biomarkers, and microbiota characteristics of 80 male Yunshan Black Goats (6 months, ~35.82 ± 2.79 kg), divided into four diets: 1) High Energy-High Protein (HEHP), 2) High Energy-Low Protein (HELP), 3) Low Energy-High Protein (LEHP), and 4) Low Energy-Low Protein (LELP). Twenty goats (five from each treatment group) were randomly slaughtered after a 50-day feeding trial, and cecal digesta and tissue were sampled for microbial analysis. RESULTS: The cecal content revealed that the high-energy groups (HEHP, HELP) had lower pH levels than the LEHP group ( CONCLUSION: This study demonstrated that dietary energy and protein levels significantly influenced cecal fermentation, immune biomarkers, and microbiota composition in Yunshan Black Goats.