A vibrating cantilever technique is presented, which allows the continuous measurement of the tip-sample interaction force F int(z) in the contact as well as in the non-contact region as a function of the tip-sample distance z. The method relies on the measurement of the frequency difference Δf = f — f0 between the eigenfrequency f 0 of the free cantilever and the actual resonance frequency f of the cantilever, which is influenced by the tip-sample interaction potential. From such frequency shift data, F int(z) can be reconstructed, as we will demonstrate with the example of a silicon tip vibrating near a graphite surface. The resulting F int(z)-curves are subsequently used to extract parameters like the adhesion force F ad or the point of contact Z c . A detailed comparison with suitable model interactions additionally opens an elegant way to investigate the mechanics of the nanocontact, which behaves in good approximation as expected from the so-called Hertz-plus-offset model.