Atomic pair distribution function (PDF) analysis is the most powerful technique to study the structure of condensed matter on the length scale from short- to long-range order. Today, the PDF approach is an integral part of research on amorphous, nanocrystalline and disordered materials from bulk to nanoparticle size. Thin films, however, demand specific experimental strategies for enhanced surface sensitivity and sophisticated data treatment to obtain high-quality PDF data. The approach described here is based on the surface high-energy X-ray diffraction technique applying photon energies above 60 keV at grazing incidence. In this way, reliable PDFs were extracted from films of thicknesses down to a few nanometres. Compared with recently published reports on thin-film PDF analysis from both transmission and grazing-incidence geometries, this work brought the minimum detectable film thickness down by about a factor of ten. Depending on the scattering power of the sample, the data acquisition on such ultrathin films can be completed within fractions of a second. Hence, the rapid-acquisition grazing-incidence PDF method is a major advancement in thin-film technology that opens unprecedented possibilities for in situ and operando PDF studies in complex sample environments. By uncovering how the structure of a layered material on a substrate evolves and transforms in terms of local and average ordering, this technique offers new opportunities for understanding processes such as nucleation, growth, morphology evolution, crystallization and the related kinetics on the atomic level and in real time.