Objective To analyze the adverse reaction reports of pembrolizumab and nivolumab by using the openFDA database,providing evidences for rational drug use in clinic.Methods Used the requests library to obtain openFDA data from the API interface.The data collection period was limited from January 1,2014 to October 1,2022.Adverse reactions of the two PD1 inhibitors were classified by preferred system organ class(SOC)and preferred term(PT),and risk signals were calculated using the reporting odds ratio(ROR)method.Results A total of 43,160 adverse reaction reports for pembrolizumab and 67,546 for nivolumab were received.There were 120 ROR-positive PT signals for pembrolizumab and 124 for nivolumab.Among the top 50 PTs,pembrolizumab involved 16 SOCs and nivolumab 17.Overall,the adverse reactions of pembrolizumab and nivolumab were similar:the strong ROR positive signal distribution of pembrolizumab was the highest in the respiratory system,while the positive signal of nivolumab was the highest in the endocrine system.Conclusion Mining real-world adverse event data for two PD-1 inhibitors to obtain rates of immune adverse reactions,identify potential adverse reaction risks,compare organ system tendencies in adverse reactions to PD-1 inhibitors,and assist in early detection and timely intervention of immune-related adverse reactions in clinical settings,ensuring medication safety.