Pitaya is a well-known fruit widely cultivated in tropical and subtropical tropical regions, and is characterized by its flesh colour into red, white, and yellow pitaya. Red pitaya has dark red flesh and is the preferred choice among consumers due to its superior taste compared to other varieties. Red pitaya has been known to cause diarrhoea, and studies have reported that pitaya does this by drawing moisture into the intestines, resulting in defecation. However, the exact mechanism of action is still unclear. In this study, mass spectrometry was employed to identify small molecular compounds in red pitaya powder, and a loperamide hydrochloride-induced early constipation mouse model was used to assess the efficacy of red pitaya. 16S rDNA and non-targeted metabolomics techniques were used to systematically reveal the regulatory characteristics of the intestinal flora and to identify the intestinal metabolites associated with constipation. The results showed that 44 novel small molecular compounds were identified from red pitaya powder, including a variety of phenolic acids and flavonoids. Pathological results showed that administration of red pitaya powder at a high dose (1000 mg kg