In vivo real-time monitoring gastric acid is of great importance for diagnosis and treatment of gastrointestinal diseases. Herein, we synthesized a pH-responsive photoacoustic (PA) nanoprobe (denoted as LET-4) based on near-infrared (NIR) dye (IR1061) for in vivo photoacoustic imaging (PAI) of gastric acid in living subjects. In the acidic condition, the protonated LET-4 nanoprobe has a strong absorbance peak at 808 nm, followed by a strong PA signal output at 808 nm. The PA808 signal at pH 3 is 3.45-fold higher than the signal at pH 7. More importantly, the LET-4 nanoprobe could monitor in vivo gastric acid secretion assessment in animal model using PAI. This organic small molecule NIR dye-based probe with simple components, facile preparation, good biocompatibility, and rapid excretion has great potential for gastrointestinal disease diagnosis.