The adsorption of 2-amino-5-cyanopyridine (2-ACP) was investigated in solution at different pH values by in situ surface-enhanced Raman scattering (SERS) spectroscopy combined with the electrochemical method. The assignments of the main bands were first performed on the basis of the spectral features of similar compounds and with the help of density functional theory calculations. The results revealed that the adsorption and the interfacial structure of 2-ACP on the Au electrode depended on the applied potential and the pH values of the solution. In the natural solution, 2-ACP was adsorbed on the surface with a vertical orientation by the CN group from − 0.4 to − 1.0 V, whereas in the − 0.4 to 0.8 V range, the N atom of the pyridine ring was bound to the surface. A transition region for the reorientation of the two adsorption modes was observed from − 0.8 to − 0.4 V. A flat configuration was preferred at an extremely negative potential. A similar surface adsorption behavior was observed in the alkali environment, while the Stark effect slope decreased because of the adsorption of OH−. Due to the protonation of N atom in the acidic solution, the potential region for the coexistence of two configurations ranged from − 0.4 to 0.2 V. Additionally, a similar adsorption configuration was proposed on the Au colloids at various pH values. The results revealed that the adsorption behavior became more complex on colloidal surfaces than that on a rigid electrode surface. Copyright © 2010 John Wiley & Sons, Ltd.