Entanglement, and, in particular, the entanglement spectrum, plays a major role in characterizing many-body quantum systems. While there has been a surge of theoretical works on the subject, no experimental measurement has been performed to date because of the lack of an implementable measurement scheme. Here, we propose a measurement protocol to access the entanglement spectrum of many-body states in experiments with cold atoms in optical lattices. Our scheme effectively performs a Ramsey spectroscopy of the entanglement Hamiltonian and is based on the ability to produce several copies of the state under investigation, together with the possibility to perform a global swap gate between two copies conditioned on the state of an auxiliary qubit. We show how the required conditional swap gate can be implemented with cold atoms, either by using Rydberg interactions or coupling the atoms to a cavity mode. We illustrate these ideas on a simple (extended) Bose-Hubbard model where such a measurement protocol reveals topological features of the Haldane phase.