The identification of chemicals from their mid-infrared spectra has applications that include industrial production of chemicals, food production, pharmaceutical manufacturing, and environmental monitoring. This is generally done using laboratory benchtop tools, such as the Fourier transform infrared spectrometer. Although such systems offer high performance, alternative platforms offering reduced size, weight, and cost can enable a host of new applications, e.g. in consumer personal electronics. Here a compact microspectrometer platform for chemical identification, comprising a mid-infrared metasurface integrated with a lightweight (≈1 g) and very small (≈1 cm 3 ) microbolometer-based thermal camera is experimentally demonstrated. A machine learning algorithm is trained to analyze the microspectrometer output and classify chemicals based on their mid-infrared fingerprints. High accuracy identification of four liquid chemicals, concentration quantification of ethyl lactate in cyclohexane down to subpercentage levels, and the classification of food and drug samples is demonstrated.