a method and apparatus for determining the concentration of organic acids in formation fluids is provided including pumps for pumping fluids from a subterranean formation into the body of a downhole tool and sources for illuminating the flow with infrared radiation to obtain the infrared absorption or a related parameter at one or more wavelengths , and processors for converting the measured absorption into the concentration of the organic acids , using for example a multi - value calibration matrix which relates ir absorption spectral values to concentration measurement under downhole conditions .