Optical beam shifts, such as the Goos–Hänchen (GH) shift and the Imbert–Fedorov (IF) shift, are fundamental optical phenomena. However, because these shifts are so minute, direct measurement is challenging, and obtaining an optical shift spectrum is even more difficult. Here, we successfully obtained GH and IF shift spectra using a beam displacement amplification technique. The optical shift spectrum of graphene shows very good agreement with the predicted results. Meanwhile, we observed two distinct peaks in the optical shift spectrum of WS2, corresponding to the A- and B-exciton transitions at the K-point in the Brillouin zone. More importantly, when graphene is stacked on WS2 to form a van der Waals heterostructure, the A-exciton characteristic of WS2 increases by an order of magnitude, which is essentially different from absorption and fluorescence spectra. Furthermore, refractive index change can be precisely captured by GH shift spectroscopy, which proves the optical shift spectrum to be an ideal candidate for a highly sensitive biosensor. Optical shift spectroscopy could enable new applications for nanophotonic devices and provide a platform for the study of intrinsic properties of two-dimensional materials, especially for van der Waals heterostructure.