Objective This study aims to build a differential diagnosis model for unipolar and bipolar depression based on clinical features and blood indicators.Methods According to inclusion and exclusion criteria,participants with unipolar and bipolar depression were included,and clinical data and blood test indicators of the participants were extracted.The data were randomly divided into a training set and a testing set.Classification models were trained on the training set using extreme gradient boosting based on different feature combinations,and the performance of the models was validated on the testing set.Receiver operating characteristic(ROC),area under curve(AUC),sensitivity,specificity and accuracy were used to evaluate model performance.The SHapley additive explanations(SHAP)method was used to calculate the importance of selected features for the differential diagnosis of unipolar and bipolar depression.Results In the unipolar and bipolar depression classification model,the XGBoost model performs the best,with an AUC of 0.889,sensitivity of 0.831,specificity of 0.839,and accuracy of 0.863.The main features in this model include duration of illness,age of onset,albumin,low-density lipoprotein,blood potassium concentration,white blood cell count,platelet/lymphocyte ratio,and monocytes.Conclusion Duration of illness and hematological biomarkers,which are easily obtainable in clinical settings,can provide important support for the differential diagnosis of unipolar and bipolar depression.