Single-shot temperature measurements by coherent anti-Stokes Raman scattering have been made in an operating spark-ignited engine. From the individual measurement pairs (pressure and temperature) mean temperature and pressure have been computed versus crank angle with the engine operated at light or heavy loads. Dispersion due to cycle-to-cycle variations have been analysed. The measurements have also been performed with the engine operating under knocking conditions. Temperature evolution of the end-gas versus knock intensity is presented and discussed. Temperature evolution of the burnt gas at a given crank angle in the expansion stroke is also presented.