To determine the spectral class of a star, the necessary piece of spectral data is temperature. The spectral class is primarily categorized based on the temperature of the star, which affects its color and the type of spectra it produces. Therefore, the correct option is:
temperature