Apiose is a natural pentose containing an unusual branched-chair structure. Apiosides are bioactive natural products widely present in the plant kingdom. However, the essential apiosylation reaction in the biosynthetic pathways of apiosides has been missing. In this work, we report the first apiosyltransferase GuApiGT, which from medicinal plant Glycyrrhiza uralensis. GuApiGT could efficiently catalyze 2″-O-apiosylation of flavonoid glycosides, and exhibits strict sugar donor selectivity towards UDP-apiose. We solved the crystal structure of GuApiGT, determined a key sugar-binding motif (RLGSDH) through structural analysis and theoretical calculations, and obtained mutants with altered sugar selectivity through protein engineering. Based on the motif, we discovered 121 candidate apiosyltransferase genes from Leguminosae plants, and identified the functions of 4 enzymes. Moreover, we introduced GuApiGT and its upstream genes into Nicotiana benthamiana, and completed de novo biosynthesis of a series of flavonoid apiosides, including the anti-tussive compound liquiritin apioside at a yield of 5.46 mg/g (DW).