BackgroundPrimary antibody deficiencies (PAD) are characterized by a heterogeneous clinical presentation and low prevalence, contributing to a median diagnostic delay of 3–10 years. This increases the risk of morbidity and mortality from undiagnosed PAD, which may be prevented with adequate therapy. To reduce the diagnostic delay of PAD, we developed a screening algorithm using primary care electronic health record (EHR) data to identify patients at risk of PAD. This screening algorithm can be used as an aid to notify general practitioners when further laboratory evaluation of immunoglobulins should be considered, thereby facilitating a timely diagnosis of PAD.MethodsCandidate components for the algorithm were based on a broad range of presenting signs and symptoms of PAD that are available in primary care EHRs. The decision on inclusion and weight of the components in the algorithm was based on the prevalence of these components among PAD patients and control groups, as well as clinical rationale.ResultsWe analyzed the primary care EHRs of 30 PAD patients, 26 primary care immunodeficiency patients and 58,223 control patients. The median diagnostic delay of PAD patients was 9.5 years. Several candidate components showed a clear difference in prevalence between PAD patients and controls, most notably the mean number of antibiotic prescriptions in the 4 years prior to diagnosis (5.14 vs. 0.48). The final algorithm included antibiotic prescriptions, diagnostic codes for respiratory tract and other infections, gastro-intestinal complaints, auto-immune symptoms, malignancies and lymphoproliferative symptoms, as well as laboratory values and visits to the general practitioner.ConclusionsIn this study, we developed a screening algorithm based on a broad range of presenting signs and symptoms of PAD, which is suitable to implement in primary care. It has the potential to considerably reduce diagnostic delay in PAD, and will be validated in a prospective study.Trial registrationThe consecutive prospective study is registered at clinicaltrials.gov under NCT05310604Supplementary InformationThe online version contains supplementary material available at 10.1186/s13223-023-00790-7.