ABSTRACT The local position invariance (LPI) is one of the three major pillars of Einstein equivalence principle, ensuring the space–time independence on the outcomes of local experiments. The LPI has been tested by measuring the gravitational redshift effect in various depths of gravitational potentials. We propose a new cosmological test of the LPI by observing the asymmetry in the cross-correlation function between different types of galaxies, which predominantly arises from the gravitational redshift effect induced by the gravitational potential of haloes at which the galaxies reside. We show that the ongoing/upcoming galaxy surveys give a fruitful constraint on the LPI-violating parameter, α, in the distant universe (redshift z ∼ 0.1–1.8) over the cosmological scales (separation s ∼ 5–$10\, {\rm \mathit{ h}^{ -1}\,Mpc}$) that have not yet been explored, finding that the expected upper limit on α can reach 0.03.