BackgroundTraditional viral illness surveillance relies on in-person clinical or laboratory data, paper-based data collection, and outdated technology for data transfer and aggregation. We aimed to assess whether continuous sensor data can provide an early warning signal for COVID-19 activity as individual physiological and behavioural changes might precede symptom onset, care seeking, and diagnostic testing.MethodsThis multivariable, population-based, modelling study recruited adult (aged ≥18 years) participants living in the USA who had a smartwatch or fitness tracker on any device that connected to Apple HealthKit or Google Fit and had joined the DETECT study by downloading the MyDataHelps app. In the model development cohort, we included people who had participated in DETECT between April 1, 2020, and Jan 14, 2022. In the validation cohort, we included individuals who had participated between Jan 15 and Feb 15, 2022. When a participant joins DETECT, they fill out an intake survey of demographic information, including their ZIP code (postal code), and surveys on symptoms, symptom onset, and viral illness test dates and results, if they become unwell. When a participant connects their device, historical sensor data are collected, if available. Sensor data continue to be collected unless a participant withdraws from the study. Using sensor data, we collected each participant's daily resting heart rate and step count during the entire study period and identified anomalous sensor days, in which resting heart rate was higher than, and step count was lower than, a specified threshold calculated for each individual by use of their baseline data. The proportion of users with anomalous data each day was used to create a 7-day moving average. For the main cohort, a negative binomial model predicting 7-day moving averages for COVID-19 case counts, as reported by the Centers for Disease Control and Prevention (CDC), in real time, 6 days in the future, and 12 days in the future in the USA and California was fitted with CDC-reported data from 3 days before alone (H0) or in combination with anomalous sensor data (H1). We compared the predictions with Pearson correlation. We then validated the model in the validation cohort.FindingsBetween April 1, 2020, and Jan 14, 2022, 35 842 participants enrolled in DETECT, of whom 4006 in California and 28 527 in the USA were included in our main cohort. The H1 model significantly outperformed the H0 model in predicting the 7-day moving average COVID-19 case counts in California and the USA. For example, Pearson correlation coefficients for predictions 12 days in the future increased by 32·9% in California (from 0·70 [95% CI 0·65–0·73] to 0·93 [0·92–0·94]) and by 12·2% (from 0·82 [0·79–0·84] to 0·92 [0·91–0·93]) in the USA from the H0 model to the H1 model. Our validation model also showed significant correlations for predictions in real time, 6 days in the future, and 12 days in the future.InterpretationOur study showed that passively collected sensor data from consenting participants can provide real-time disease tracking and forecasting. With a growing population of wearable technology users, these sensor data could be integrated into viral surveillance programmes.FundingThe National Center for Advancing Translational Sciences of the US National Institutes of Health, The Rockefeller Foundation, and Amazon Web Services.