The simulation of EXAFS spectra of thin films via ab initio methods is discussed. The procedure for producing the spectra is presented as well as an application to a two-dimensional material (WSe 2 ) where the effectiveness of this method in reproducing the spectrum and the linear dichroic response is shown. A series of further examples in which the method has been employed for the structural determination of materials are given.