HBsAg and HBeAg have gained traction as biomarkers of control and clearance during monitoring of chronic hepatitis B virus infection (CHB). An improved understanding of the correlates of clearance of these proteins could help inform improvements in patient-stratified care and advance insights into the underlying mechanisms of disease control, thus underpinning new cure strategies. We collected electronic clinical data via an electronic pipeline supported by the National Institute for Health Research Health Informatics Collaborative (NIHR-HIC), adopting an unbiased approach to generating a robust longitudinal dataset for adults testing HBsAg-positive from a large UK teaching hospital over a six year period (2011-2016 inclusive). From 553 individuals with CHB, longitudinal data were available for 319, representing >107,000 weeks of clinical follow-up. Among these 319 individuals, 13 (4%) cleared HBsAg completely. HBsAg clearance rate was similar in individuals on NA therapy (n=4, median clearance time 150 weeks) vs those not on NA therapy (n=9, median clearance time 157 weeks). Those who cleared HBsAg were significantly older, and less likely to be on NA therapy compared to non-clearers (p=0.003 and p=0.001, respectively). Chinese ethnicity was associated with HBeAg positivity (p=0.025). HBeAg clearance occurred both on NA therapy (n=24, median time 49 weeks) and off NA therapy (n=19, median time 52 weeks). Improved insights into the dynamics of these biomarkers can underpin better prognostication and patient-stratified care. Our systematised approach to data collection paves the way for scaling up efforts to harness clinical data to address research questions and underpin improvements in clinical care provision.