  We present a detailed analysis of the stacked frequency spectrum of a large
sample of galaxy clusters using Planck data, together with auxiliary data from
the AKARI and IRAS missions. Our primary goal is to search for the imprint of
relativistic corrections to the thermal Sunyaev-Zeldovich effect (tSZ)
spectrum, which allow to measure the temperature of the intracluster medium. We
remove Galactic and extragalactic foregrounds with a matched filtering
technique, which is validated using simulations with realistic mock data sets.
The extracted spectra show the tSZ signal at high significance and reveal an
additional far-infrared (FIR) excess, which we attribute to thermal emission
from the galaxy clusters themselves. This excess FIR emission from clusters is
accounted for in our spectral model. We are able to measure the tSZ
relativistic corrections at $2.2\sigma$ by constraining the mean temperature of
our cluster sample to $4.4^{+2.1}_{-2.0} \, \mathrm{keV}$. We repeat the same
analysis on a subsample containing only the 100 hottest clusters, for which we
measure the mean temperature to be $6.0^{+3.8}_{-2.9} \, \mathrm{keV}$,
corresponding to $2.0\sigma$. The temperature of the emitting dust grains in
our FIR model is constrained to $\simeq 20 \, \mathrm{K}$, consistent with
previous studies. Control for systematic biases is done by fitting mock
clusters, from which we also show that using the non-relativistic spectrum for
SZ signal extraction will lead to a bias in the integrated Compton parameter
$Y$, which can be up to 14% for the most massive clusters. We conclude by
providing an outlook for the upcoming CCAT-prime telescope, which will improve
upon Planck with lower noise and better spatial resolution.
