Excess count detection ('excode') in epidemiological time series is an important part of public health surveillance systems. The 'excode' package provides a flexible framework that implements well established approaches to control for seasonality, long-term trends and historic events, but also allows the use of customized models. By combining hidden Markov models and generalized linear models, 'excode' explicitly models normally expected case counts and expected excess case counts.