The frequencies of extended X-ray absorption fine-structure (EXAFS) measurements, which are oscillations occurring on the high-energy side of an X-ray absorption edge, can be used to identify interatomic distances in materials. We have used a dispersive X-ray spectrometer, which has no moving components, to make rapid measurements with minimal energy drift of the difference in EXAFS from the Fe K edge in an iron-cobalt thin film undergoing periodic strain through magnetostriction. We show that magnetostriction can be detected by differential X-ray absorption. The magnitude of the recorded signal relative to the noise shows a sensitivity to mean differential atomic motion of one femtometre: a factor of 100 times more sensitive than that normally available.