This study aimed to investigate the potential use of anthocyanin of Berberis crataegina DC. as a natural food coloring agent in the food industry. For this aim, the ultrasound-assisted extraction (UAE) method was performed to extract anthocyanin of Berberis crataegina DC. The effect of ultrasound power (X-1: 20-100%), extraction temperature (X-2: 20-60 degrees C), and time (X-3: 10-20 min) on TPC and TAC of Berberis crataegina DC. extracts were examined and optimized by applying the Box-Behnken experimental design (BBD) with the response surface methodology (RSM). The influence of three independent variables and their combinatorial interactions on TPC and TAC were investigated by the quadratic models (R-2: 0.9638&0.9892 and adj R-2:0.9171&0.9654, respectively). The optimum conditions were determined as the amplitude level of 98%, the temperature of 57.41 degrees C, and extraction time of 13.86 min. The main anthocyanin compounds were identified, namely, Delphinidin-3-O-galactoside, Cyanidin-3-O-glucoside, Cyanidin-3-O-rutinoside, Petunidin-3-O-glucoside, Pelargonidin-3-O-glucoside, and Peonidin-3-O-glucoside. The anthocyanin degradation showed first-order kinetic, degradation rate constant (k), the half-life values (t(1/2)), and loss (%) were significantly affected by different temperatures (P < 0.05). Higher degradation (k) in anthocyanin content was observed at 90 degrees C. This study suggested that UAE is an efficient method for the extraction of TPC and TAC from Berberis crataegina DC.