The invention relates to a method for quantifying the composition of a product, comprising the following steps: irradiation of the product using a radiation source in the near infra-red spectrum; capture of the radiation that is reflected or transmitted by the product and provision of an output signal corresponding to the intensity of the captured radiation at a number of different wavelengths; determination, based on the output signal by means of a mathematical method, of whether the product lies within predetermined integrity criteria. According to the invention, the moving product contains a solution or homogeneous dispersion and the content of at least one substance contained in said dispersion or solution is quantitatively determined. The invention also relates to a device for carrying out said method.