Integrative conservation research on animal behavior and nutritional health can contribute to the ex situ conservation of endangered species. Stereotypic behavior, a repetitive behavior without practical function, is associated with animal welfare in its manner and frequency for captive animals. Exploring the potential relationship between stereotypic behavior and internal factors, such as intestinal flora, could improve ex situ conservation, especially for endangered species. In this study, we analyzed the typical behavior characteristics of the endangered sun bears (