The spectrum of laser-plasma generated X-rays is very important, it characterizes electron dynamics in plasma and is basic for applications. However, the accuracies and efficiencies of existing methods to diagnose the spectrum of laser-plasma based X-ray pulse are not very high, especially in the range of several hundred keV. In this study, a new method based on electron tracks detection to measure the spectrum of laser-plasma produced X-ray pulses is proposed and demonstrated. Laser-plasma generated X-rays are scattered in a multi-pixel silicon tracker. Energies and scattering directions of Compton electrons can be extracted from the response of the detector, and then the spectrum of X-rays can be reconstructed. Simulations indicate that the energy resolution of this method is approximately 20% for X-rays from 200 to 550 keV for a silicon-on-insulator pixel detector with 12 $rm mu$m pixel pitch and 500 $rm mu$m depletion region thickness. The results of a proof-of-principle experiment based on a Timepix3 detector are also shown.