Atomic force microscopy (AFM) is coupled with time-domain two-dimensional infrared (2DIR) spectroscopy to develop AFM-2DIR nanospectroscopy, which combines the spatial precision of AFM with the rich spectroscopic information provided by 2DIR spectroscopy. Application of this method reveals the anharmonicity of a carbonyl vibrational mode and the possible energy transfer pathways of hyperbolic phonon polaritons in isotope-rich hexagonal boron nitride.