We present a method to show that low-energy states of quantum many-body interacting systems in one spatial dimension are nonlocal. We assign a Bell inequality to the Hamiltonian of the system in a natural way and we efficiently find its classical bound using dynamic programming. The Bell inequality is such that its quantum value for a given state, and for appropriate observables, corresponds to the energy of the state. Thus, the presence of nonlocal correlations can be certified for states of low enough energy. The method can also be used to optimize certain Bell inequalities: in the translationally invariant (TI) case, we provide an exponentially faster computation of the classical bound and analytically closed expressions of the quantum value for appropriate observables and Hamiltonians. The power and generality of our method is illustrated through four representative examples: a tight TI inequality for 8 parties, a quasi TI uniparametric inequality for any even number of parties, ground states of spin-glass systems, and a non-integrable interacting XXZ-like Hamiltonian. Our work opens the possibility for the use of low-energy states of commonly studied Hamiltonians as multipartite resources for quantum information protocols that require nonlocality.