In this paper, we estimate the time-varying COVID-19 contact rate of a Susceptible-Infected-Recovered (SIR) model. Our measurement of the contact rate is constructed using data on actively infected, recovered and deceased cases. We propose a new trend ﬁltering method that is a variant of the Hodrick-Prescott (HP) ﬁlter, constrained by the number of possible kinks. We term it the sparse HP ﬁlter and apply it to daily data from ﬁve countries: Canada, China, South Korea, the UK and the US. Our new method yields the kinks that are well aligned with actual events in each country. We ﬁnd that the sparse HP ﬁlter provides a fewer kinks than the l1 trend ﬁlter, while both methods ﬁtting data equally well. Theo-retically, we establish risk consistency of both the sparse HP and l1 trend ﬁlters. Ultimately, we propose to use time-varying contact growth rates to document and monitor outbreaks of COVID-19.