Accurate forecasting of hospital outpatient visits is beneficial to the rational planning and allocation of medical resources to meet medical needs. Several studies have suggested that outpatient visits are related to meteorological environmental factors. We aimed to use the autoregressive integrated moving average (ARIMA) model to analyze the relationship between meteorological environmental factors and outpatient visits. Also, outpatient visits can be forecast for the future period. Monthly outpatient visits and meteorological environmental factors were collected from January 2015 to July 2021. An ARIMAX model was constructed by incorporating meteorological environmental factors as covariates to the ARIMA model, by evaluating the stationary $${R}^{2}$$
R
2
, coefficient of determination $${R}^{2}$$
R
2
, mean absolute percentage error (MAPE), and normalized Bayesian information criterion (BIC). The ARIMA $${(0, 1, 1) (0, 1, 0)}_{12}$$
(
0
,
1
,
1
)
(
0
,
1
,
0
)
12
model with the covariates of $$\text{SO}_{2}$$
SO
2
, $${PM}_{2.5}$$
PM
2.5
, and $$\text{CO}$$
CO
was the optimal model. Monthly outpatient visits in 2019 can be predicted using average data from past years. The relative error between the predicted and actual values for 2019 was 2.77%. Our study suggests that $$\text{SO}_{2}$$
SO
2
, $${PM}_{2.5}$$
PM
2.5
, and $$\text{CO}$$
CO
concentration have a significant impact on outpatient visits. The model built has excellent predictive performance and can provide some references for the scientific management of hospitals to allocate staff and resources.