Asteroseismology provides the means both to constrain the global properties and to probe the internal structures of stars. Asteroseismic data are now available on large numbers of solar-type stars, thanks in particular to the CoRoT and Kepler space missions, and automated data-analysis pipelines are needed to provide efficient and timely results. Here, we present an automated algorithm that is able to extract mode parameters under low signal-to-noise ratio conditions. We use a Bayesian framework to ensure the robustness of the algorithm. We discuss the efficiency of the method and test it using Variability of Solar Irradiance and Gravity Oscillations (VIRGO) Sun-as-a-star photometry data and the artificial Astero Fitting at Low Angular degree Group (asteroFLAG) Kepler ensemble. Analysis of the VIRGO data shows that it is possible to track variations of the individual mode parameters (frequency, height, width) through the solar cycle, using short time series (30 days). The present analysis also revealed a modulation of the degree l = 2 relative height through the solar cycle. Applied on asteroFLAG data, we show that the pipeline extracts accurately the central frequency and the large separation. It is also able to identify the degree of the modes in 78 per cent of stars.