We consider the inverse scattering problem to reconstruct a local perturbation of a given inhomogeneous periodic layer in R d , d = 2, 3, using near field measurements of the scattered wave on an open set of the boundary above the medium, or, the measurements of the full wave in some area. The appearance of the perturbation prevents the reduction of the problem to one periodic cell, such that classical methods are not applicable and the problem becomes more challenging. We first show the equivalence of the direct scattering problem, modeled by the Helmholtz equation formulated on an unbounded domain, to a family of quasi-periodic problems on a bounded domain, for which we can apply some classical results to provide unique existence of the solution to the scattering problem. The reformulation of the problem is also the key idea for the numerical algorithm to approximate the solution, which we will describe in more detail. Moreover, we characterize the smoothness of the Bloch-Floquet transformed solution of the perturbed problem w.r.t. the quasi-periodicity to improve the convergence rate of the numerical approximation. Afterward, we define two measurement operators, which map the perturbation to some measurement data, and show uniqueness results for the inverse problems, and the ill-posedness of these. Finally, we provide numerical examples for the direct problem solver as well as examples of the reconstruction in 2D and 3D.