Bayesian methods which utilize Bayes theorem to update the knowledge of desired parameters after each measurement, are used in a wide range of quantum science. For various applications in quantum science, efficiently and accurately determining a quantum transition frequency is essential. However, the exact relation between a desired transition frequency and the controllable experimental parameters is usually absent. Here, we propose an efficient scheme to search the suitable conditions for a desired quantum transition via an adaptive Bayesian algorithm, and experimentally demonstrate it by using coherent population trapping in an ensemble of laser-cooled $^{87}$Rb atoms. The transition frequency is controlled by an external magnetic field, which can be tuned in realtime by applying a d.c. voltage. Through an adaptive Bayesian algorithm, the voltage can automatically converge to the desired one from a random initial value only after few iterations. In particular, when the relation between the target frequency and the applied voltage is nonlinear, our algorithm shows significant advantages over traditional methods. This work provides a simple and efficient way to determine a transition frequency, which can be widely applied in the fields of precision spectroscopy, such as atomic clocks, magnetometers, and nuclear magnetic resonance.