We propose a spectrometric method to detect a classical weak force acting upon the moving end mirror in a cavity optomechanical system. The force changes the equilibrium position of the end mirror, and thus the resonance frequency of the cavity field depends on the force to be detected. As a result, the magnitude of the force can be inferred by analyzing the single-photon emission and scattering spectra of the optomechanical cavity. Since the emission and scattering processes are much faster than the characteristic mechanical dissipation, the influence of the mechanical thermal noise is negligible in this spectrometric detection scheme. We also extent this spectrometric method to detect a monochromatic oscillating force by utilizing an optomechanical coupling modulated at the same frequency as the force.