With the development of offshore wind power towards large-scale and deep-sea, the safety risks and the difficulty of intelligent operation and maintenance of offshore wind turbine (OWT) during operation periods have increased significantly. Structural vibration response is an important factor affecting the safety and stability of OWT. Accurate prediction on vibration through environmental conditions and operational factors can identify the safety risks of OWT in advance, and reduce harmful vibration through appropriate operation strategy regulation. Therefore, a vibration acceleration prediction method of OWT structures was proposed in this research based on Harris hawks optimization (HHO) and extreme gradient boosting (XGBoost). Firstly, approximately two months of monitoring data from a 3 MW OWT were extracted to establish the database for training the machine learning models. Then, the key hyperparameters of XGBoost were optimized by the HHO algorithm and compared with other typical algorithms. Finally, the trained prediction model was applied to the regularity analysis of different conditions and long time series data. The analysis results demonstrate that the proposed method can effectively predict the vibration acceleration response of OWT structures using operational and environmental characteristics, and has higher accuracy and stability than other methods, with R2 of 0.9715 and mean absolute percentage error (MAPE) of 6.55%. Simultaneously, it also shows acceptable accuracy on the long-term measured data because the MAPE of chosen summer, autumn, and winter samples were calculated as 9.60%, 11.76%, and 7.21%, respectively. The establishment of the HHO-XGBoost vibration prediction model can be applied in the subsequent prediction of the vibration trend, which provides a guarantee for the safe and stable operation of OWT.