The online detection of liquid flow rate in gas-liquid two-phase flow has become an important factor in ensuring the safe operation of gas wells. In this paper, the real-time measurement of liquid holdup in gas-liquid two-phase flow is carried out by analyzing the characteristics of vibration signals excited by gas-liquid two-phase flow impacting on the pipe wall. Firstly, an acceleration sensing detection and processing system is constructed to obtain the vibration signals excited by gas-liquid two-phase flow impacting on the pipe wall. Then, the pure airflow vibration signals at different flow velocities and the gas-liquid two-phase flow excitation vibration signals at different liquid flow rates are tested, respectively, and the time-frequency characteristics analysis based on STFT is implemented. The practice shows the following: firstly, the frequency band of 6.5−15 Hz is identified as the characteristic frequency band of liquid flow rate in gas-liquid two-phase flow. Secondly, the liquid holdup is positively correlated with the vibration energy in its characteristic frequency band. Thirdly, a mathematical model of the relationship between liquid flow rate and vibration energy is constructed. Finally, the measurement error of liquid holdup is within 10%. This research method has laid a good foundation for the subsequent detection of characteristic parameters of each phase in gas-solid-liquid complex multiphase flow fluids, and it has certain application and promotion value.