How to improve online medical quality is an important challenge for practitioners of digital health platforms. Gamification creates new opportunities to deal with the problem persistent in online health services. To better understand the role of gamification in online health services context, this study intends to use the research method of machine learning and natural experiment to explore the impact of achievement gamification on online medical quality in online health services, as well as the moderating effects of doctors’ personality and image. Theoretically, this study will expand the application of game strategy in the field of healthcare, and make up for the deficiency of the effects of gamification on online medical quality. Practically, it provides guidance for promoting doctors' online participation behavior, improves the quality of online health services, and suggests ways for optimizing the rational allocation of online health resources.